Configuring Alibaba mysql under centos7

Keywords: Database MySQL cmake yum Oracle

After the open-source cross platform development framework Weex, Alibaba once again announced another major open-source project AliSQL.
The performance of this version is about 70% better than that of community mysql
Alibaba mysql git address git address: https://github.com/alibaba/AliSQL.git
0. Check whether there is mysql residue on this machine. If so, delete it

rm /etc/my.cnf
yum remove mysql mysql-server mysql-libs compat-mysql51(51 Version)
rm –rf /var/lib/mysql

Check whether mysql software still exists and delete

rpm -qa|grep mysql
yum –y remove Software name queried

1. Because Alibaba MYSQL provides source code, you need to compile it yourself.

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

2. Install cmake and download the required version from https://cmake.org/download/

 wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz 
 tar -zxvf cmake-2.8.10.2.tar.gz   
 cd cmake-2.8.10.2  
./bootstrap ; make ; make install 

3. Install bison and download the required version from http://ftp.gnu.org/gnu/bison/ (version 2.7 is used this time)

   tar -zxvf bison-2.7.tar.gz
   sudo yum install bison-2.7

4. Set AliSQL users and groups and other related configurations

groupadd mysql 
useradd -r -g mysql mysql

5. Add required folders

 mkdir -p /usr/local/mysql
 mkdir -p /data/mysqldb

6. Download Alibaba SQL source address: https://github.com/alibaba/AliSQL
Decompression
If unzip does not, you can use the following command to create it. If so, please ignore

yum install -y unzip zip;

decompression

unzip AliSQL-master.zip

Enter the extracted directory

cd AliSQL-master

7. Compile and install (Note: to rerun the configuration, you need to delete the CMakeCache.txt file rm CMakeCache.txt)

cmake\
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \  
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \  
-DDEFAULT_CHARSET=utf8 \  
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \  
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \ 
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DMYSQL_DATADIR=/data/mysqldb \
-DMYSQL_TCP_PORT=3306 \  
-DENABLE_DOWNLOADS=1  

Compile

make

install

make install

8. Modify AliSQL directory owner and group

cd  /usr/local/mysql 
chown -R mysql:mysql.
cd  /data/mysqldb  
chown -R mysql:mysql.

9. Initialize database

 cd  /usr/local/mysql           
scripts/mysql_install_db  --user=mysql  --datadir=/data/mysqldb

Errors may occur after initialization:

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

At this time, install autoconf library to solve the problem

yum –y install autoconf 

10. Copy the AliSQL service startup profile

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

Selective coverage
11. Copy AliSQL service startup script and add path

cp  support-files/mysql.server  /etc/init.d/mysqld
vim  /etc/profile
 PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH

  export PATH

         source/etc/profile

12. Start MYSQL service

 service mysqld start

13. Add power on auto start

chkconfig --level 35 mysqld on

14. View mysql status

 service mysqld status
SUCCESS! MySQL running (1759)

15. Enter mysql

mysql -u root -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 32
Server version: 5.6.32 Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

Posted by flit on Wed, 11 Dec 2019 09:23:28 -0800