Percona MySQL 5.6 RPM包方式安裝流程

feelpurple發表於2016-08-08
--去官網下載RPM安裝包

--解壓安裝包
[root@localhost percona-xtrabackup-2.4.4-Linux-x86_64]# tar xvf Percona-Server-5.6.31-77.0-r5c1061c-el6-x86_64-bundle.tar
--安裝資料庫
[root@localhost percona-xtrabackup-2.4.4-Linux-x86_64]# yum localinstall Percona-Server-server-56-5.6.31-rel77.0.el6.x86_64.rpm Percona-Server-client-56-5.6.31-rel77.0.el6.x86_64.rpm Percona-Server-shared-56-5.6.31-rel77.0.el6.x86_64.rpm
--編輯配置檔案
[root@localhost mysql]# vim /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
innodb_buffer_pool_size = 128M
--啟動資料庫
[root@localhost mysql]# mysqld_safe --defaults-file=/etc/my.cnf &
[1] 3246
--修改ROOT密碼
[root@localhost mysql]# mysqladmin -u root password 'root'
Warning: Using a password on the command line interface can be insecure.
--刪除資料庫中多餘的root使用者和匿名使用者,只在本地保留一個root使用者
[root@localhost mysql]# mysql -u root -p'root'
mysql> select host,user from mysql.user;
+-----------------------+------+
| host                  | user |
+-----------------------+------+
| 127.0.0.1             | root |
| ::1                   | root |
| localhost             |      |
| localhost             | root |
| localhost.localdomain |      |
| localhost.localdomain | root |
+-----------------------+------+
6 rows in set (0.00 sec)
mysql> delete from mysql.user where (user,host) not in (select 'root','localhost');
Query OK, 5 rows affected (0.06 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select host,user from mysql.user;
+-----------+------+
| host      | user |
+-----------+------+
| localhost | root |
+-----------+------+
1 row in set (0.00 sec)
--檢視資料庫的執行狀態
[root@localhost mysql]# /etc/init.d/mysql status
 SUCCESS! MySQL (Percona Server) running (6584)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2123170/,如需轉載,請註明出處,否則將追究法律責任。

相關文章