1: Download Install CMake (mysql5.5 is compiled by CMake later)
| 123456789101112131415161718 |
#http://download.csdn.net/detail/csxuedn/7976005#wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz# tar -zxv -f /root/cmake-2.8.4.tar.gz# cd cmake-2.8.4#./configureError whenbootstrapping CMake:Cannot find appropriate C++ compiler onthis system.Please specify one using environment variable CXX.See cmake_bootstrap.log forcompilers attempted. #yum install gcc-c++#./configure# make && make install |
2: Create MySQL installation directory and database storage directory
| 12 |
#mkdir -p /gechong/mysql //安装mysql#mkdir -p /gechong/mysql/data //存放数据库 |
3: Create MySQL users and user groups
| 1 |
#useradd -g mysql -s /bin/false-M mysql |
4: Install MySQL
| 1 |
#wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.21.tar.gz |
[[email protected] gechong]# ls
Mysql
[Email protected] gechong]# pwd
/gechong
[Email protected] gechong]# tar-zxv-f/root/mysql-5.6.21.tar.gz
[Email protected] gechong]# CD mysql-5.6.21/
Compile:
| 1234567 |
cmake . \-DCMAKE_INSTALL_PREFIX=/gechong/mysql \-DMYSQL_DATADIR=/gechong/mysql/data \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-DEXTRA_CHARSETS=all\-DENABLED_LOCAL_INFILE=1 |
The error:
| 1234567891011 |
CMake Error at cmake/readline.cmake:85 (MESSAGE): Curses library notfound. Please install appropriate package, remove CMakeCache.txt andrerun cmake.OnDebian/Ubuntu, package nameislibncurses5-dev, onRedhat andderivates it isncurses-devel.Call Stack (most recent call first): cmake/readline.cmake:128 (FIND_CURSES) cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE) CMakeLists.txt:427 (MYSQL_CHECK_EDITLINE) -- Configuring incomplete, errors occurred! |
| 1 |
#yum -y install ncurses-devel |
Recompile:
# Make Clean
# rm-f CMakeCache.txt
# RM-RF/ETC/MY.CNF
| 1234567 |
cmake . \-DCMAKE_INSTALL_PREFIX=/gechong/mysql \-DMYSQL_DATADIR=/gechong/mysql/data \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-DEXTRA_CHARSETS=all\-DENABLED_LOCAL_INFILE=1 |
Very slow ... Wait a while.
5: Configure MySQL
| 1 |
# cd /gechong/mysql<br># chown -R root:mysql .<br># chown -R mysql:mysql data |
6:
| 1 |
# cp support-files/my-default.cnf /etc/my.cnf |
7: Initialize permission table
| 1 |
#scripts/mysql_install_db --user=mysql |
8: Start the MySQL service
| 123 |
#ln -s /gechong/mysql/bin/mysql /usr/bin#service mysqld start |
10: After the empty user login MySQL, delete the empty user, assign permissions to the user.
http://blog.csdn.net/langeldep/article/details/6223649
CentOS 6.5 Source Installation MySQL5.6