Environment: CentOS6.5, minimized installation environment
1. Preparation
Yum Install Lrzsz gcc* Libaio
Yum Erase mysql-libs-5.1.71-1.el6.x86_64
2. Download mysql5.6
http://dev.mysql.com/downloads/mysql/
3. Upload and Unzip
Tar XF Mysql-5.6.20-1.el6.x86_64.rpm-bundle.tar
4. Installation
RPM-IVH mysql-server-5.6.20-1.el6.x86_64.rpm mysql-client-5.6.20-1.el6.x86_64.rpm MySQL-devel-5.6.20-1.el6.x86_ 64.rpm mysql-shared-compat-5.6.20-1.el6.x86_64.rpm
5. Default configuration file
/USR/MY.CNF-------Configuration file
/var/lib/mysql/------Default DataDir
/var/lib/mysql/master.err---------Log files
/var/lib/mysql/master.pid----------Store MySQL process number
/var/lib/mysql/mysql.sock------------Sock File
/home/root/.mysql_secret-------------5.6 added, mysql default password file (not empty) after the new installed root
6. Start
Service MySQL Start
7, to resolve the issue of starting the background log:
[Warning] TIMESTAMP with implicit the DEFAULT value is deprecated. --explicit_defaults_for_timestamp server Option (seedocumentation for more details).
Modify/USR/MY.CNF Add parameter
Explicit_defaults_for_timestamp
8. Change the root password of MySQL
[[email protected] ~]# mysqladmin-u root-p password New password
Enter Password: old password
Note: The newly installed MySQL password see file/home/root/.mysql_secret
9. Modify the configuration file/usr/my.cnf
Port = 3306
Socket =/var/lib/mysql/mysql.sock
DataDir =/var/lib/mysql
user = MySQL
Configuration file By default there is only one sentence: Sql_mode=no_engine_substitution,strict_trans_tables
You can use the Mysqld_safe command to start the MySQL service after modification
Mysqld_safe--DEFAULTS-FILE=/USR/MY.CNF &
At this point, a non-optimized MySQL server is installed OK!!
。。。。。。。。。。
。。。。
Second, start multiple MySQL services on a single server
1. New configuration file/etc/my.cnf
Cp/usr/my.cnf/etc/my.cnf
2. Create DATABASE Data Directory
mkdir-pv/var/lib/3307
Chown-r mysql.mysql/var/lib/3307
3. Modify the configuration file/etc/my.cnf
Port = 3307
Socket =/var/lib/3307/mysql.sock
DataDir =/var/lib/3307
user = MySQL
4. Database initialization
mysql_install_db--defaults-file=/etc/my.cnf
The first time you install the server, the database is initialized by default. So, without this step
5. Start the service
Mysqld_safe--DEFAULTS-FILE=/ETC/MY.CNF &
6, authentication, directly with the root launched
4 of processes
[[email protected] ~]# ps-ef|grep MySQL
Root 4627 2710 0 Nov28 pts/1 00:00:00/bin/sh/usr/bin/mysqld_safe--defaults-file=/usr/my.cnf
MySQL 4771 4627 0 Nov28 pts/1 00:00:02/usr/sbin/mysqld--defaults-file=/usr/my.cnf--basedir=/usr--datadir=/var /lib/mysql--plugin-dir=/usr/lib64/mysql/plugin--user=mysql--log-error=/var/lib/mysql/master.err--pid-file=/var /lib/mysql/master.pid--socket=/var/lib/mysql/mysql.sock--port=3306
Root 5377 2710 0 Nov28 pts/1 00:00:00/bin/sh/usr/bin/mysqld_safe--defaults-file=/etc/my.cnf
MySQL 5519 5377 0 Nov28 pts/1 00:00:01/usr/sbin/mysqld--defaults-file=/etc/my.cnf--basedir=/usr--datadir=/var /lib/3307--plugin-dir=/usr/lib64/mysql/plugin--user=mysql--log-error=/var/lib/3307/master.err--pid-file=/var/ Lib/3307/master.pid--socket=/var/lib/3307/mysql.sock--port=3307
Port 2 x
[[email protected] ~]# netstat-natpl|grep MySQL
TCP 0 0::: 3307:::* LISTEN 5519/mysqld
TCP 0 0::: 3306:::* LISTEN 4771/mysqld
Start multiple MySQL services on the same server, and the second step is to build a few more my.cnf.
This article is from the "1058223494" blog, please be sure to keep this source http://4708705.blog.51cto.com/4698705/1584073
One, MySQL installation