Open Terminal
Switch to the root directory
[Shell@localhost ~]# Su-Uninstall CentOS's own Mysql5.0 before installing Mysql5.5.
[Root@localhost ~]# yum Remove MySQL
Install CMake
Download CMake Source Pack cmake-2.8.5.tar.gz
[Root@localhost ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz compilation installation [root@localhost]# tar XZVF cmake-2.8.5.tar.gz [root@localhost]# cd cmake-2.8.5 [root@localhost cmake-2.8.5]#./bootstrap Error when bootstrapping Cmake:cannot find appropriate C compiler in this system. Please specify one using environment variable CC. Cmake_bootstrap.log for compilers attempted. Error: The compiler for C is missing.
Workaround: Install the GCC compiler
Can be installed from the Linux system installation disk, or simply install with Yum
[root@localhost ~]# yum Install gcc
continue the installation of CMake
[Root@localhost cmake-2.8.5]#./bootstrap Error when bootstrapping cmake:cannot find appropriate C + + compiler on this sys Tem. Please specify one of the using environment variable CXX. Cmake_bootstrap.log for compilers attempted. Error again: missing C + + compiler.
Installing the gcc-c++ compiler
The same can be installed from the Linux system installation disk, or simply install with Yum
[Root@localhost ~]# Yum Install gcc-c++
repeat the above action
[Root@localhost cmake-2.8.5]#./bootstrap
After no error, compile the installation
[Root@localhost cmake-2.8.5]# make [root@localhost cmake-2.8.5]# make Install[root@localhost cmake-2.8.5]# cmake- Version
start the formal installation of MySQL
Add MySQL users and user groups
[Root@localhost ~]# groupadd MySQL [root@localhost ~]# useradd-g MySQL MySQL
Download the MySQL source pack mysql-5.5.27.tar.gz
[Root@localhost ~]# wget http://dev.mysql.com/Downloads/MySQL-5.5/mysql-5.5.27.tar.gz Decompression
[Root@localhost ~]# cd/usr/local/[root@localhost local]# tar xzvf mysql-5.5.27.tar.gz[root@localhost local]# CD mysql-5 .5.27
CMake Run
[Root@localhost mysql-5.5.27]# CMake.
Error:
--Could Curses (missing:curses_library Curses_include_path) CMake Error at cmake/readline.cmake:82 (message): C Urses Library not found. Please install appropriate package, remove CMakeCache.txt and rerun CMake. On Debian/ubuntu, package name are Libncurses5-dev, on Redhat and derivates it is ncurses-devel. Call Stack (most recent call I): cmake/readline.cmake:126 (find_curses) cmake/readline.cmake:216 (mysql_use_bundled _libedit) cmakelists.txt:250 (mysql_check_readline)--Configuring incomplete, Errors occurred!
Solution:
[Root@localhost mysql-5.5.27]# rm CMakeCache.txt [root@localhost mysql-5.5.27]# yum-y Install ncurses-devel*
re-cmake run
[Root@localhost mysql-5.5.27]# CMake. There's a warning.
Warning:bison executable not found in path has a warning, it also solves it, the lack of Bison is installed
[root@localhost mysql-5.5.27]# Yum Install Bison
run again, no error
[Root@localhost mysql-5.5.27]# CMake. Before compiling the installation, you can set configuration options for the installation
[Root@localhost mysql-5.5.27]#./configure--help Choose the options you want to set according to the Help information, and of course you can skip this step, by default
#开始编译安装, the time is a little bit longer ...
[Root@localhost mysql-5.5.27]# make && make install complete the build installation
Enter the installation directory, change the ownership of the program binaries to root, change the ownership of the data directory to MySQL user, update the authorization form
[Root@localhost mysql-5.5.27]# cd/usr/local/mysql[root@localhost mysql]# chown-r root. [Root@localhost mysql]# chown-r MySQL. [Root@localhost mysql]# chgrp-r MySQL. [Root@localhost mysql]# scripts/mysql_install_db--user=mysql Initialization database [root@localhost mysql]#/usr/local/mysql/scripts /mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data safely boot MySQL
[Root@localhost mysql]#./bin/mysqld_safe--user=mysql shut down MySQL
[Root@localhost mysql]#./bin/mysqladmin-u root shutdown-p default password is easy to call, set a soft link for MySQL [root@localhost ~]# ln-s /mysql/bin/mysql/usr/bin/mysql
Other Settings processing:
set the option file to copy the profile to/etc
[Root@localhost mysql]# CP support-files/my-medium.cnf/etc/mysql.cnf Setup boot from [root@localhost mysql]# CP support-files/ Mysql.server/etc/init.d/mysql [root@localhost mysql]# chmod +x/etc/init.d/mysql [root@localhost mysql]# Chkconfig–add Mysqld[root@localhost mysql]# chkconfg mysqld on
the MySQL server can now be started and closed by service
[root@localhost ~]# service MySQL start [root@localhost ~]# service MySQL shutdown
connecting to a server
[Root@localhost ~]# mysql-u root-pyourpasswordwelcome to the MySQL monitor. Commands End With; or \g.your MySQL connection ID is 3 to server version:5.5.27 Source distributinotype ' help; ' or ' \h '. The type ' \c ' to clear the buffer.mysql> ...mysql> prompt tells you that MySQL is ready to enter commands for you.
MySQL is now installed and ready to use
Mysql> QUIT