Tuesday, June 20, 2017

how to fix Got error 'this version of PCRE is compiled without UTF support at offset 0' from regexp

on mysql error:
how to fix Got error 'this version of PCRE is compiled without UTF support at offset 0' from regexp

fix:
1.
install aclocal-1.15 from
https://github.com/gp187/nginx-builder/blob/master/fix/aclocal.sh
2.
./configure --prefix=/opt/lampp --enable-utf8 --enable-unicode-properties && make
make install

install automake 1.15 using aclocal.sh

#!/bin/bash

# run as root only
if [[ $EUID -ne 0 ]] ; then
    echo -e "\e[1;39m[   \e[31mError\e[39m   ] need root access to run this script\e[0;39m"
    exit 1
fi

function install_automake() {
    [ $# -eq 0 ] && { run_error "Usage: install_automake <version>"; exit; }
    local VERSION=${1}
    wget ftp://ftp.gnu.org/gnu/automake/automake-${VERSION}.tar.gz &> /dev/null
    if [ -f "automake-${VERSION}.tar.gz" ]; then
            tar -xzf automake-${VERSION}.tar.gz
            cd automake-${VERSION}/
            ./configure
            make && make install
            echo -e "\e[1;39m[   \e[1;32mOK\e[39m   ] automake-${VERSION} installed\e[0;39m"

        else
            echo -e "\e[1;39m[   \e[31mError\e[39m   ] cannot fetch file from ftp://ftp.gnu.org/gnu/automake/ \e[0;39m"
            exit 1
    fi
}
install_automake 1.15

Monday, June 19, 2017

create database , user , grant privileges and import in mysql

CREATE DATABASE mydb
  DEFAULT CHARACTER SET utf8
  DEFAULT COLLATE utf8_general_ci;

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON DbName.* TO 'newuser'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON DbName.* TO 'newuser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
SHOW GRANT FOR 'newuser'@'localhost';
or
DROP USER ‘demo’@‘localhost’;

>mysql -u root -p database_name < database.sql