Before starting the installation, first describe the difference between the mysql-5.6.4 and the lower version in the installation, from the mysql-5.5, mysql source code installation began to use cmake, so when we configure the installation directory. /configure -- perfix = /..... there will be some differences from the previous ones, which we will mention later.
Related reading: MySQL 5.6.4 M7 released
I. Decompress mysql-5.6.4-m7-tar.zip
1> the unzip mysql-5.6.4-m7-tar.zip will generate a compressed file named mysql-5.6.4-m7-tar.gz
2> the tar-zxvf mysql-5.6.4-m7-tar.gz generates a folder for the mysql-5.6.4-m7
Next, we need to configure the installation directory for specific installation. here we need to note that the cmake application needs to be installed when using cmake.
Download the compressed package cmake-2.8.10.1.tar.gz unzip tar-zxvf cmake-2.8.10.1.tar.gz to get the file cmake-2.8.10.1 into the cd cmake-2.8.10.1 <we now create the directory mkdir cmake_exe on the outer layer>
(1) configure the installation directory./configure -- prefix =/home/houqingdong/cmake_exe (2) make (3) make install
3> well here our cmake has been installed successfully, into the mysql-5.6.4-m7 cd/usr/local/mysql-5.6.4-m7 <assuming that mysql has been created in the outer layer>
4> run the following command based on the Conversion Relationship:
Cmake. -DCMAKE_INSTALL_PREFIX =/usr/local/mysql Press enter. Note that sometimes a prompt is displayed, saying that the cmake command is not used, but the cmake command has just been installed. It doesn't matter, just fill it in the PATH: export PATH =/home/houqingdong/cmake_exe/bin: $ PATH and then run it.
5> after the make install command is executed, a prompt indicating successful installation is displayed.
6> useradd mysql creates a user named mysql.
7> install the default database: Run (su-mysql) cd/usr/local/mysql/scripts/as mysql/
Sudo./mysql_install_db -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data/-- user = mysql
Here, I encountered an error during execution because the password is required to execute sudo, but after I enter it, it prompts me That the mysql user is not in the sudoers Folder:
Then return to the root user and execute: visodu add mysql ALL = (ALL) ALL to the row root user.
After execution, run the above command: sudo./mysql_install_db -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data/-- user = mysql.
8> copy the mysql configuration file and service file to the System Configuration path.
Cpmy-medium.config/etc/my. conf cp mysql. server/etc/init. d/mysqld
9> start the service
Service mysqld start |/etc/init. d/mysql start add to start automatically (chkconfig -- add mysqld)
10> Add the mysql root User password: mysql-u root password 'your _ password
11> View startup status in the process ps-ef | grep mysqld
From this, we can see that mysql is started as the root user, and the installation directory and port number are also displayed.
12> link to the database: