Install MySQL5.6.12 in Linux source code (Cmake compilation)
Install MySQL 5.6.12 (Cmake compilation) in Linux source code)
1. Install the make Compiler (default system)
:
Tar zxvf make-3.82.tar.gz
Cd make-3.82
./Configure
Make
Make install
2. Install bison
:
Tar zxvf bison-2.5.tar.gz
Cd bison-2.5
./Configure
Make
Make install
3. Install gcc-c ++
:
Tar zxvf gcc-c00000000-4.4.4.tar.gz
Cd gcc-c ++-4.4.4
./Configure
Make
Make install
4. Install cmake
:
Tar zxvf cmake-2.8.4.tar.gz
Cd cmake-2.8.4
./Configure
Make
Make install
5. Install ncurses
:
Tar zxvf ncurses-5.8.tar.gz
Cd ncurses-5.8
./Configure
Make
Make install
Start to install MySQL ,,:
Preparations
Groupadd mysql
Useradd-r-g mysql
Decompress and install MySQL
Tar zxvf mysql-5.5.13.tar.gz
Cd mysql-5.5.13
Cmake ./
-DCMAKE_INSTALL_PREFIX =/usr/local/mysql/
-DINSTALL_DATADIR =/usr/local/mysql/data
Make
Make install
After completion, continue the following operations
Cd/usr/local/mysql
Chown-R mysql.
Chgrp-R mysql.
Scripts/mysql_install_db -- user = mysql
Chown-R root.
The following command is optional. Copy the mysql configuration file to/etc.
Cp support-files/my-medium.cnf/etc/my. cnf
Start mysql:
Bin/mysqld_safe -- user = mysql &
# Start mysql to check whether it is successful
Netstat-tnl | grep 3306
The above is a method to start mysql, there is a simple and convenient, as follows:
# Add the mysql startup service to the System Service
Cp support-files/mysql. server/etc/init. d/mysql. server
# Run the following command to start mysql:
Service mysql. server start
# Stopping the mysql Service
Service mysql. server stop
# Restart the mysql Service
Service mysql. server restart
Add the mysql service to the startup Item to enable the mysql service to start up.
Chkconfig -- add mysql. server
After the machine is restarted, the mysql service starts automatically.
Related reading:
Compile and install MySQL 5.5 Based on Cmake
Installing mysql-5.5.10 in Cmake Mode
Install MySQL 5.5.13 Cmake in CentOS