Compile under CentOS installation AliSQL


If you install MySQL RM/etc/my.cnf unload, otherwise ignore


Uninstall the installed MySQL


Yum remove MySQL MySQL-Server MySQL-libs compat-mysql51 (51 to version)


rm –rf /var/lib/mysql


rm /etc/my.cnf


See if there are MySQL software


rpm -qa|grep mysql


If there is, will continue to


Yumy remove query software


First, to do before you compile and install AliSQL


1, tools and libraries required to compile the source code


yum install gcc gcc-c++ ncurses-devel perl


2, cmake installed, or download the required version from




3)、cd cmake-


4)、./bootstrap ; make ; make install


5)、cd ~


3, the installation of bison from the required version



2)、sudo yum install bison-2.7


3)、cd ~


Second, set the AliSQL user and group


1, add AliSQL users and groups


groupadd mysql


2, AliSQL new user


useradd -r -g mysql mysql


List of required to three, AliSQL


1, new AliSQL to the installation directory


mkdir –p /usr/local/mysql


2, the new AliSQL database data file directory


mkdir -p /data/mysqldb


Four, download the AliSQL source code and extract


Download from source code


1), decompression




2)、cd AliSQL-master


Five, compile and install AliSQL


1, set the compile parameters




-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \


-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \




-DDEFAULT_COLLATION=utf8_general_ci \








-DMYSQL_DATADIR=/data/mysqldb \












Re-run the configuration, you need to remove CMakeCache.txt files


rm CMakeCache.txt


2, compile the source code




3, the installation of


make install


Six, modify the AliSQL directory owner and group


1, modify AliSQL to the installation directory


1)、cd /usr/local/mysql


2)、chown -R mysql:mysql .


2, modify the AliSQL database file directory


1)、cd /data/mysqldb


2)、chown -R mysql:mysql .


Seven, the initialization AliSQL databases


cd /usr/local/mysql


scripts/mysql_install_db –user=mysql –datadir=/data/mysqldb




Error occurred while initializing the database:


FATAL ERROR:please install the following Perl modules before executingscripts/mysql_install_db:




Installed: autoconf


Command: yumy install autoconf//the package installation is installed when Data::Dumper


Initialization AliSQL databases command again


Eight, copy AliSQL service startup configuration file


cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf


Note: If the/etc/my.cnf file exists, it is overwritten


Kowloon, copy AliSQL startup script and join the path path


cp support-files/mysql.server /etc/init.d/mysqld


vim /etc/profile




export PATH




Ten, start the AliSQL service and add powerboot (optional)


service mysqld start


chkconfig –level 35 mysqld on


Third, check whether the service starts


netstat -tulnp | grep 3306


mysql -u root -p