Install the latest version of Mysql5.6 and centos6.4mysql5.6 in the tar package under Centos6.4.
1. Download
Mysql: http://www.mysql.com/downloads/ (ORACLE account to be registered)
Version: mysql-advanced-5.6.21-linux-glibc2.5-x86_64.tar.gz
Linux: centos6.4 x64
2. Installation
2.1upload mysql-advanced-5.6.21-linux-glibc2.5-x86_64.tar.gz to the/usr/local/directory in linux Through ssh.
2.2 clear the original mysql: yum remove mysql
2.3 install the mysql dependency package:
[Root @ localhost ~] # Yum install gcc
[Root @ localhost ~] # Yum install gcc-c ++
[Root @ localhost ~] # Yum installcmake
2.4 Add mysql groups and users
[Root @ localhost ~] # Groupadd mysql
[Root @ localhost ~] # Useradd-g mysql
2.5mysql unzip installation and rename
[Root @ localhost ~] # Tar-zxvf mysql-advanced-5.6.21-linux-glibc2.5-x86_64.tar.gz
[Root @ localhost ~] # Music mysql-advanced-5.6.21-linux-glibc2.5-x86_64.tar.gz mysql
2.6 compile and install
[Root @ localhost mysql] # make & make install
2.7 enter the installation directory, change the binary ownership of the program to root, and change the data directory description to a mysql user to update the authorization table.
[Root @ localhost mysql] # 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
Start MySQL safely (the default password is blank)
[Root @ localhost mysql] #./bin/mysqld_safe -- user = mysql &
2.8 error:
120908 00:16:25 mysqld_safe Logging to '/usr/local/mysql/data/CentOS. err '.
120908 00:16:26 mysqld_safe Starting mysqld daemon with databases from/usr/local/mysql/data
Solution: Change the user permission of Centos. err to a mysql user.
[Root @ localhost ~] # Cd/usr/local/mysql/data
[Root @ localhost data] # chgrp-R mysql CentOS. err
Connect to the local MySQL
[Root @ localhost mysql] # mysql-u root-p
Enter password. The default value is null. Press Enter.
Disconnect
Mysql> exit;
2.9 set a password for the root account
[Root @ localhost ~] # Cd/usr/local/mysql/bin
[Root @ localhost mysql] #./bin/mysqladmin-u root password 123456
Enter Password: 123456
2.10
Set the option file and copy the configuration file to/etc.
[Root @ localhost mysql] # cp support-files/my-medium.cnf/etc/mysql. cnf
[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 mysql on
2.11 start and close Mysql through services
[Root @ localhost ~] # Service mysql start
[Root @ localhost ~] # Service mysql stop
. After the installation and configuration are complete, you only need to start, connect, disconnect, close, and restart. The command is as follows:
[Root @ localhost mysql] # service mysql start
[Root @ localhost mysql] #./bin/mysql-u root-p123456
Mysql> exit;
[Root @ localhost mysql] # service mysql stop
[Root @ localhost mysql] # service mysql restart
3. Set mysql remote login 3.1 login [root @ localhost mysql] #./bin/mysql-u root-p123456
3.2 authorize the root user TO log on to any ip address and refresh mysql> grant all privileges on *. * TO 'root' @ '% 'identified by' with grant option;
Mysql> flush privileges;
You are welcome to join us in the discussion and study!
Collect it by yourself!
Record and share, let you grow together! Welcome to my other blog; my blog address: http://blog.csdn.net/caicongyang