0. Installation CMake
[root@lyq314 ~]# TAR-ZXVF cmake-2.8.11.2.tar.gz
[root@lyq314 cmake-2.8.11.2]#./configure
[Root@lyq314 cmake-2.8.11.2]# make
[root@lyq314 cmake-2.8.11.2]# make install
1, add MySQL users and groups
[root@lyq314 ~] #groupadd MySQL
[root@lyq314 ~] #useradd-g MySQL MySQL
2, compile the MySQL program
[root@lyq314 tar_mysql]# TAR-ZXVF mysql-5.5.30.tar.gz
[root@lyq314 ~]# CD mysql-5.5.30/
/usr/local/bin/cmake \
-dcmake_install_prefix=/usr/local/mysql5.5 \
-dmysql_unix_addr=/tmp/mysql.sock \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dwith_extra_charsets:string=utf8,gbk,gb2312 \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_readline=1 \
-denabled_local_infile=1 \
-dmysql_datadir=/home/mysql/data \
-dwith_debug=0
[root@lyq314 mysql-5.5.30]# make && make install
This column more highlights: http://www.bianceng.cn/database/MySQL/
3, copy the database configuration file and make changes
[root@lyq314 ~]# cp-ar/usr/local/mysql5.5/support-files/my-medium.cnf/usr/local/mysql5.5/etc/lyq314.cnf
4. Initializing the database
/usr/local/mysql5.5/scripts/mysql_install_db--defaults-file=/usr/local/mysql5.5/etc/lyq314.cnf--basedir=/usr/ LOCAL/MYSQL5.5/--datadir=/home/mysql/data--user=mysql
5. Add Environment variables
[root@lyq314 ~]# echo "Export path= $PATH:/usr/local/mysql5.5/bin" >>/etc/profile
[root@lyq314 ~]# Source/etc/profile
6, the start of MySQL
/usr/local/mysql5.5/bin/mysqld_safe--defaults-file=/usr/local/mysql5.5/etc/lyq314.cnf--datadir=/home/mysql/ Data--user=mysql &
7. View MySQL service port
# NETSTAT-TUNLP
[Root@localhost etc]# NETSTAT-NLTP |grep 3306
TCP 0.0.0.0:3306 0.0.0.0:* listen24752/mysqld
8, set the administrator password
/usr/local/mysql5.5/bin/mysqladmin-u root password ' 1q2w3e4r '
#/usr/local/mysql5.5/bin/mysqladmin-u root-p1q2w3e4r password ' 123456 '
9, log in to the database for testing
[root@lyq314 mysql-5.5.30]#/usr/local/mysql5.5/bin/mysql-uroot-p
Enter Password:
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 11
Server Version:5.5.30-log Source Distribution
Copyright (c), 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark the Oracle Corporation and/or its
Affiliates. Names may trademarks of their respective
Owners.
Type ' help, ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| MySQL |
| Performance_schema |
| Test |
+--------------------+
4 rows in Set (0.02 sec)
Mysql>
10, the MySQL shutdown
[root@lyq314 mysql-5.5.30]#/usr/local/mysql5.5/bin/mysqladmin-uroot-p shutdown
Enter Password:
130717 00:31:09 mysqld_safe mysqld from PID File/home/mysql/data/lyq314.pid ended