Open Terminal
Switch to the root directory
[Shell @ localhost ~] # Su-uninstall Mysql5.0 from CentOS before installing Mysql5.5.
[Root @ localhost ~] # Yum remove mysql
Install cmake
Download the cmakesource code package cmake-2.8.5.tar.gz
[Root @ localhost ~] # Wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gzcompilation install unzip 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 on this system. please specify one using environment variable CC. see cmake_bootstrap.log for compilers attempted. error: The C compiler is missing.
Solution: Install the gcc compiler.
It can be installed from the installation disk of the Linux system, or simply by using yum
[Root @ localhost ~] # Yum install gcc
Continue cmake Installation
[Root @ localhost cmake-2.8.5] #. /bootstrap Error when bootstrapping CMake: Cannot find appropriate C ++ compiler on this system. please specify one using environment variable CXX. see cmake_bootstrap.log for compilers attempted. another error is reported: The C ++ compiler is missing.
Install the gcc-c ++ Compiler
It can also be installed from the installation disk of the Linux system, or simply by using yum
[Root @ localhost ~] # Yum install gcc-c ++
Repeat the preceding operations
[Root @ localhost cmake-2.8.5] #./bootstrap
After no error is reported, compile and install
[Root @ localhost cmake-2.8.5] # make [root @ localhost cmake-2.8.5] # make install [root @ localhost cmake-2.8.5] # cmake-version
Start to officially install Mysql
Add mysql users and user groups
[Root @ localhost ~] # Groupadd mysql [root @ localhost ~] # Useradd-g mysql
Download the MySQL source code package mysql-5.5.27.tar.gz
[Root @ localhost ~] # Wget http://dev.mysql.com/downloads/mysql-5.5/mysql-5.5.27.tar.gzunzip
[Root @ localhost ~] # Cd/usr/local/[root @ localhost local] # tar xzvf mysql-5.5.27.tar.gz [root @ localhost local] # cd mysql-5.5.27
Run cmake
[Root @ localhost mysql-5.5.27] # cmake.
Error:
-- Cocould NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH) CMake Error at cmake/readline. cmake: 82 (MESSAGE): Curses library not found. please install appropriate package, remove CMakeCache.txt and rerun cmake. on Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel. call Stack (most recent call first): cmake/readline. cmake: 126 (FIND_CURSES) cmake/re Adline. cmake: 216 (MYSQL_USE_BUNDLED_LIBEDIT) CMakeLists.txt: 250 (MYSQL_CHECK_READLINE) -- inserting ing incomplete, errors occurred!
Solution:
[Root @ localhost mysql-5.5.27] # rm CMakeCache.txt [root @ localhost mysql-5.5.27] # yum-y install ncurses-devel *
Run cmake again
[Root @ localhost mysql-5.5.27] # cmake. There is still a warning
Warning: Bison executable not found in PATH has a Warning and solves it. If Bison is missing, install it.
[Root @ localhost mysql-5.5.27] # yum install bison
Run again, no error reported
[Root @ localhost mysql-5.5.27] # cmake. You can set the installation configuration options before compiling and Installation
[Root @ localhost mysql-5.5.27] #./configure -- help select the option you need to set based on the help information, of course, you can skip this step, by default settings
# Start compilation and installation. The time is a little longer...
[Root @ localhost mysql-5.5.27] # make & make install complete compilation and Installation
Go to the installation directory, change the binary ownership of the program to root, change the ownership of the data directory to mysql user, and update the authorization table.
[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 to start mysql safely
[Root @ localhost mysql] #./bin/mysqld_safe -- user = mysql disable mysql
[Root @ localhost mysql] #./bin/mysqladmin-u root shutdown-p default password is empty for convenient calling, set a soft link for mysql [root @ localhost ~] # Ln-s/usr/local/mysql/bin/mysql/usr/bin/mysql
Other settings:
Set the option file and copy the configuration file to/etc.
[Root @ localhost mysql] # cp support-files/my-medium.cnf/etc/mysql. cnf is set to boot automatically [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
Now you can start and close the Mysql server through the service.
[Root @ localhost ~] # Service mysql start [root @ localhost ~] # Service mysql shutdown
Connect to the 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' for help. type '\ C' to clear the buffer. mysql>... mysql> the prompt tells you that mysql is ready to enter the Command for you.
MySQL has been properly installed and can be used
Mysql> QUIT