These days under the CentOS install MySQL, here to record the installation process, convenient for later review
Mysql5.5.37 installation needs to start cmake,5.6 version cmake to compile, 5.5 later version should also install this.
Installing CMake
[Plain] View plaincopyprint?01. [Email protected] ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
02.[[email protected] ~]# tar xvf cmake-2.8.12.2.tar.gz
03.[[email protected] ~]# CD cmake-2.8.12.2
04.[[email protected] Cmake-2.8.12.2]#./bootstrap
05.[[email protected] cmake-2.8.12.2]# make
06.[[email protected] cmake-2.8.12.2]# make install
[Email protected] ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
[Email protected] ~]# tar xvf cmake-2.8.12.2.tar.gz
[Email protected] ~]# CD cmake-2.8.12.2
[Email protected] Cmake-2.8.12.2]#./bootstrap
[[email protected] cmake-2.8.12.2]# make
[[email protected] cmake-2.8.12.2]# make install MySQL
[Plain] View plaincopyprint?01. [Email protected] ~]# wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz
02.[[email protected] ~]# tar xvf mysql-5.5.37.tar.gz
03.[[email protected] ~]# CD mysql-5.5.37
04.[[email protected] mysql-5.5.37]# cmake.
[Email protected] ~]# wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz
[Email protected] ~]# tar xvf mysql-5.5.37.tar.gz
[Email protected] ~]# CD mysql-5.5.37
[Email protected] mysql-5.5.37]# CMake.
It's probably going to be a mistake, not a jump.
[Plain] View Plaincopyprint?01.cmake Error at cmake/readline.cmake:83 (MESSAGE):
02.Curses Library not found. Pleaseinstall appropriate package,
03.remove CMakeCache.txt and rerun CMake. On Debian/ubuntu, package name Islibncurses5-dev, on Redhat and derivates it is ncurses-devel.
04.Call Stack (most recent call first):
cmake/readline.cmake:127 (find_curses)
cmake/readline.cmake:217 (Mysql_use_bundled_libedit)
. cmakelists.txt:355 (Mysql_check_readline
08.--configuring incomplete, Errors occurred!
09.See also "/root/my/mysql-5.5.37/cmakefiles/cmakeoutput.log".
10.See also "/root/my/mysql-5.5.37/cmakefiles/cmakeerror.log".
CMake Error at cmake/readline.cmake:83 (MESSAGE):
Curses Library not found. Pleaseinstall appropriate package,
Remove CMakeCache.txt and rerun CMake. On Debian/ubuntu, package name Islibncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:127 (find_curses)
cmake/readline.cmake:217 (Mysql_use_bundled_libedit)
cmakelists.txt:355 (mysql_check_readline
--Configuring incomplete, Errors occurred!
See also "/root/my/mysql-5.5.37/cmakefiles/cmakeoutput.log".
See also "/root/my/mysql-5.5.37/cmakefiles/cmakeerror.log".
Stating that the CentOS system is not ncurses-devel
[Plain] View plaincopyprint?01. [Email protected] ~]# wgethttp://invisible-island.net/datafiles/release/ncurses.tar.gz
02.[[email protected] ~]# CD ncurses-5.9
03.[[email protected] Ncurses-5.9]#./configure
04.[[email protected] ncurses-5.9]# make
05.[[email protected] ncurses-5.9]# make install
[Email protected] ~]# wgethttp://invisible-island.net/datafiles/release/ncurses.tar.gz
[Email protected] ~]# CD ncurses-5.9
[Email protected] Ncurses-5.9]#./configure
[[email protected] ncurses-5.9]# make
[[email protected] ncurses-5.9]# make install
Then delete the CMakeCache.txt file that you just compiled, or you cannot proceed to the next step
[Plain] View plaincopyprint?01. [Email protected] mysql-5.5.37]# rm-f CMakeCache.txt
[Email protected] mysql-5.5.37]# rm-f CMakeCache.txt
Continue compiling MySQL
[Plain] View plaincopyprint?01. [Email protected] ~]# CMake.
02.[[email protected] ~]# make
03.[[email protected] ~]# make install
[Email protected] ~]# CMake.
[[email protected] ~]# make
[[email protected] ~]# make install
This way, MySQL will install successfully to/usr/local/mysql by default
Create a MySQL user group
[Plain] View plaincopyprint?01. [[email protected] ~]# Groupadd MySQL
02.[[email protected] ~]# useradd–r–g MySQL MySQL
03.[[email protected] ~]# chown–r mysql.mysql/usr/local/mysql
[[email protected] ~]# Groupadd MySQL
[[email protected] ~]# useradd–r–g MySQL MySQL
[Email protected] ~]# chown–r mysql.mysql/usr/local/mysql
Start MySQL
[Plain] View plaincopyprint?01. [Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--user=mysql
[Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--user=mysql
There may be an error, no skipping:
[Plain] View plaincopyprint?01.fatal error:could not find./bin/my_print_defaults
02.If compiled from source, you need Torun ' make install ' to
03.copy the software into the correct locationready for operation.
04.If you is using a binary release, you Musteither is at the top
05.level of the extracted archive, or pass the--BASEDIR option
06.pointing to the location.
FATAL Error:could not Find./bin/my_print_defaults
If you compiled from source, you need Torun "make install" to
Copy the software into the correct locationready for operation.
If you is using a binary release, you Musteither is at the top
Level of the extracted archive, or pass the--BASEDIR option
Pointing to the location.
Workaround:
[Plain] View plaincopyprint?01. [Email protected] ~]#/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/ Usr/local/mysql/data
[Email protected] ~]#/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/ Usr/local/mysql/data
Start MySQL again
[Plain] View plaincopyprint?01. [Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--user=mysql
[Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--user=mysql
Register MySQL service, boot automatically
1. Set up MySQL configuration file to/etc directory
[Plain] View plaincopyprint?01. [Email protected] ~]# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
[Email protected] ~]# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
2. Set up MySQL Boot
[Plain] View plaincopyprint?01. [Email protected] ~]# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql
02.[[email protected] ~]# chmod +x/etc/init.d/mysql
03.[[email protected] ~]#/sbin/chkconfig--add MySQL
[Email protected] ~]# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql
[Email protected] ~]# chmod +x/etc/init.d/mysql
[[email protected] ~]#/sbin/chkconfig--add MySQL
3. Start the MySQL service
You can add System variables: Export path=/usr/local/mysql/bin/: $PATH
[Plain] View plaincopyprint?01. [[Email protected] ~]# service MySQL start
[[Email protected] ~]# service MySQL start