1. Download
: Http://dev.mysql.com/downloads/mysql/5.6.html#downloads
Download version: I choose here 5.6.33, General edition, Linux under 64-bit
You can also directly copy the 64-bit, download by command: wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
2. Unzip
#解压
tar
-zxvf mysql-5.6.33-linux-glibc2.5-x86_64.
tar
.gz
#复制解压后的mysql目录
cp
-r mysql-5.6.33-linux-glibc2.5-x86_64
/usr/local/mysql
3. Adding user groups and users
#添加用户组
groupadd mysql
#添加用户mysql 到用户组mysql
useradd
-g mysql mysql
4, install MySQL
Go to install MySQL software directory: Execute command cd/usr/local/mysql
Modify current directory owner for MySQL User: Execute command chown-r mysql:mysql.
Install database: Executes the command./scripts/mysql_install_db--user=mysql
Modify the current directory owner as root User: Execute command chown-r root:root.
Modify the current data directory owner for MySQL User: Execute command chown-r mysql:mysql data
To this database installation is complete
Start the MySQL service and add the boot MySQL service:
Add Boot: Execute command CP Support-files/mysql.server/etc/init.d/mysql, put startup script into boot initialization directory
Start MySQL service: Execute command service MySQL start
Execute command: ps-ef|grep mysql see MySQL service description started successfully,
To modify the root user password of MySQL, the root initial password is empty:
Execute command:./bin/mysqladmin-u root password ' password '
Put the MySQL client on the default path:
Ln-s/usr/local/mysql/bin/mysql/usr/local/bin/mysql
Errors encountered during the installation
-bash:./scripts/mysql_install_db:/usr/bin/perl:bad Interpreter: No file or directory
FIX: yum-y Install Perl perl-devel
Installing MySQL system Tables..../bin/mysqld:error while loading shared libraries:libaio.so.1:cannot open shared objec T file:no such file or directory
Solution: Yum-y Install Libaio-devel
Yum-y Install Numactl
Authorization to the user
2. Authorization law.
For example, if you want to myuser use MyPassword to connect to a MySQL server from any host.
Mysql> Grant all privileges on * * to ' myuser ' @ '% ' identified by ' MyPassword ' with GRANT OPTION;
FLUSH privileges;
Linux installation MySQL