史上最簡單的MySQL安裝教程之Linux(CentOS6.8)下安裝MySQL5.6

1、準備

安裝包:Percona-Server-5.6.21-70.0-r688-el6-x86_64-bundle.tarmysql

MySQL下載地址:http://www.percona.com/doc/percona-server/5.6/sql

2、安裝

①首先安裝cmake

命令:yum -y install cmaketcp

[root@localhost opt]# yum -y install cmake

②上傳安裝包

[root@localhost /]# cd /usr/local/src/
[root@localhost src]# mkdir mysql
[root@localhost src]# cd mysql
[root@localhost mysql]# rz
[root@localhost mysql]# ls
Percona-Server-5.6.21-70.0-r688-el6-x86_64-bundle.tar

③解壓安裝包

[root@localhost mysql]# tar -xvf Percona-Server-5.6.21-70.0-r688-el6-x86_64-bundle.tar
Percona-Server-56-debuginfo-5.6.21-rel70.0.el6.x86_64.rpm
Percona-Server-client-56-5.6.21-rel70.0.el6.x86_64.rpm
Percona-Server-devel-56-5.6.21-rel70.0.el6.x86_64.rpm
Percona-Server-server-56-5.6.21-rel70.0.el6.x86_64.rpm
Percona-Server-shared-56-5.6.21-rel70.0.el6.x86_64.rpm
Percona-Server-test-56-5.6.21-rel70.0.el6.x86_64.rpm
Percona-Server-tokudb-56-5.6.21-rel70.0.el6.x86_64.rpm

④安裝客戶端和服務端

[root@localhost mysql]# rpm -ivh Percona-Server-shared-56-5.6.21-rel70.0.el6.x86_64.rpm
warning: Percona-Server-shared-56-5.6.21-rel70.0.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
Preparing...                ########################################### [100%]
   1:Percona-Server-shared-5########################################### [100%]
[root@localhost mysql]# rpm -ivh Percona-Server-client-56-5.6.21-rel70.0.el6.x86_64.rpm
warning: Percona-Server-client-56-5.6.21-rel70.0.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
Preparing...                ########################################### [100%]
   1:Percona-Server-client-5########################################### [100%]
[root@localhost mysql]# rpm -ivh Percona-Server-server-56-5.6.21-rel70.0.el6.x86_64.rpm

⑤啓動服務

[root@localhost mysql]# service mysql start
Starting MySQL (Percona Server)..                          [肯定]

⑥修改root密碼

[root@localhost mysql]# mysqladmin -u root password "123456"
Warning: Using a password on the command line interface can be insecure.

⑦登陸成功

[root@localhost mysql]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.21-70.0 Percona Server (GPL), Release 70.0, Revision 688

Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

⑧設置遠程訪問

mysql> grant all privileges on *.* to 'root' @'%' identified by '123456';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

⑨防火牆打開3306端口

[root@localhost mysql]# /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT   #開啓防火牆
[root@localhost mysql]# /etc/rc.d/init.d/iptables save   #當前規則保存,保證開機後也是開啓的
iptables:將防火牆規則保存到 /etc/sysconfig/iptables:     [肯定]
[root@localhost mysql]# /etc/init.d/iptables status  #查看iptables 防火牆已經開啓的端口

若是安裝不成功,過來打我。☺☺☺☺ide

版權聲明:本文爲博主原創文章,容許轉載,但轉載必須標明出處。spa

相關文章
相關標籤/搜索