First step: Configure the network environment, download the CMake software package (mysql5.5 is compiled by CMake later)
wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
Step Two: Press-unpack Package CMake
Tar-zxvf/data/cmake-2.8.5.tar.gz
Enter cmake-2.8.5
Step Three: Install the package gcc-c++
Yum-y Install gcc-c++
Fourth step: Execute the./configure to compile the CMake
./configure
Make && make install
Fifth step: Create the MySQL installation directory and the database storage directory
Mkdir-p/data/mysql//install MySQL
Mkdir-p/DATA/MYSQL/MYSQLDB//Storage database
Sixth step: Create MySQL users and user groups
Groupadd MySQL
Useradd-r-G MySQL MySQL
Seventh Step: Install MySQL
TAR-ZXVF mysql-5.6.24.tar.gz
cd/mysql-5.6.24
Eighth Step: Install the package Ncurses-devel
Yum-y Install Ncurses-devel
Nineth step: compiling MySQL files
CMake. \
-dcmake_install_prefix=/data/mysql \
-DMYSQL_DATADIR=/DATA/MYSQL/MYSQLDB \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dmysql_tcp_port=3306 \
-dextra_charsets=all \
-denable_downloads=1 \
-denabled_local_infile=1
Note: To rerun the configuration, you need to delete the CMakeCache.txt file
cd/data/cmake-2.8.5
Make clean
Rm-rf/etc/my.cnf
RM-RF CMakeCache.txt
Make && make install (This step takes 10 minutes)
Tenth step: Configure the MySQL service
[Email protected] ~]# chown-r mysql:mysql/data/mysql
[Email protected] ~]# chown-r mysql:mysql/data/mysql/mysqldb
11th Step: Copy support-files/my-default.cnf to/ETC/MY.CNF (note: Overwrite if/etc/my.cnf file exists)
CP SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF
12th step: Initializing MySQL Database
Cd/data/mysql
scripts/mysql_install_db--user=mysql--datadir=/data/mysql/mysqldb
13th step: Copy the MySQL service startup script and join the path path
Cd/data/mysql
CP Support-files/mysql.server/etc/init.d/mysqld
Vim/etc/profile
Path=/data/mysql/bin:/data/mysql/lib: $PATH
Export PATH
Source/etc/profile
14th Step: Modify the location of the MySQL database
Vim/etc/my.cnf
DataDir =/data/mysql/mysqldb
15th step: Start the MySQL server and join the boot
Service mysqld Start
Chkconfig--level mysqld on
16th Step: Check if the MySQL server is started
NETSTAT-TUNLP | grep 3306
17th step: Test MySQL Login
Mysql-u root-p
The password is empty and if it can be logged on, the installation is successful.
18th Step: Modify the MySQL user root password
mysqladmin-u password ' 123456 '
19th: If the following wrong solution occurs
Mysqladmin:connect to server at ' localhost ' failed
Error: ' Access denied for user ' root ' @ ' localhost ' (using Password:yes) '
Workaround:
#> Service mysqld Stop
#>mysqld_safe--skip-grant-tables &
Enter Mysql-uroot-p return Enter
>use MySQL;
> Update user Set Password=password ("NewPassword") where user= "root";
Change Password to NewPassword
> Flush Privileges; Update permissions
> Quit quitting
Operation has been completed, if there is a problem, please contact me in time!
This article is from the "Sky of Lavender" blog, be sure to keep this source http://youlei.blog.51cto.com/2669714/1652957
MySQL Database source code package compiled under the CentOS system