新聞中心
個(gè)人比較喜歡 mysql 的輕量,今天花了一點(diǎn)時(shí)間把云服務(wù)上的 MySQL5.7 換成了 Percona-server ,Percona 是一個(gè)開(kāi)源的 MySQL 衍生版。InnoDB的數(shù)據(jù)庫(kù)引擎使得 Percona 服務(wù)器非常有吸引力,如果你需要的高性能,高可靠性和高性?xún)r(jià)比的解決方案,它將是一個(gè)很好的選擇。
安裝
#安裝 yum 源
yum install http://www.percona.com/downloads/percona-release/RedHat/0.1-3/percona-release-0.1-3.noarch.rpm
#測(cè)試 YUM 源是否生效
yum list | grep percona
#安裝 Percona-Server
yum install Percona-Server-server-57 Percona-Server-client-57
#啟動(dòng)服務(wù)
service mysqld start
#登錄 MySQL
mysql -u root -p

創(chuàng)新互聯(lián)建站是專(zhuān)業(yè)的余干網(wǎng)站建設(shè)公司,余干接單;提供網(wǎng)站建設(shè)、網(wǎng)站制作,網(wǎng)頁(yè)設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專(zhuān)業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行余干網(wǎng)站開(kāi)發(fā)網(wǎng)頁(yè)制作和功能擴(kuò)展;專(zhuān)業(yè)做搜索引擎喜愛(ài)的網(wǎng)站,專(zhuān)業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來(lái)合作!
mysql5.7.x 安裝完成后會(huì)初始化一個(gè) root 用戶(hù)的隨機(jī)密碼,在 /var/log/mysqld.log 日志中可以查看到,也可以通過(guò)命令查找
[root@iZ11fek1j6cZ lib]# grep 'temporary password' /var/log/mysqld.log
2016-11-19T09:43:01.644617Z 1 [Note] A temporary password is generated for root@localhost: LibldhWL+9Fd
#修改密碼
ALTER USER USER() IDENTIFIED BY 'xxxxxxx';
#重啟 MySQL 服務(wù)
service mysql restart
#安裝配置
[root@iZ11fek1j6cZ lib]# mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.
Estimated strength of the password: 100
Change the password for root ? ((Press y|Y for Yes, any other key for No) : n
... skipping.
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n
... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.
- Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done!
#修改編碼
vi /etc/my.cnf
[client]
default-character-set = utf8
[mysqld]
default-storage-engine = INNODB
character-set-server = utf8
collation-server = utf8_general_ci
#檢查編碼
[root@iZ11fek1j6cZ etc]# service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service
[root@iZ11fek1j6cZ etc]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.15-9 Percona Server (GPL), Release 9, Revision 9f0fd0a
Copyright (c) 2009-2016 Percona LLC and/or its affiliates
Copyright (c) 2000, 2016, 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> show variables like '%char%';
+--------------------------------------+-------------------------------------+
| Variable_name | Value |
+--------------------------------------+-------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/percona-server/charsets/ |
| validate_password_special_char_count | 1 |
+--------------------------------------+-------------------------------------+
9 rows in set (0.00 sec)
#開(kāi)啟啟動(dòng)服務(wù)
systemctl enable mysqld.service
#關(guān)閉防火墻
systemctl stop firewalld.service #停止
systemctl disable firewalld.service #禁用
#開(kāi)啟遠(yuǎn)程連接
use mysql;
mysql>
update user set host = '%' where user = 'root';
mysql>select host, user from user;
#配置文件
Percona Server stores the data files in /var/lib/mysql/ by default. You can find the configuration file that is used to manage Percona Server in /etc/my.cnf.
REFER:
https://www.percona.com/doc/percona-server/5.7/installation/yum_repo.html
Percona Server 使用了一些 google-mysql-tools, Proven Scaling, Open Query 對(duì) MySQL 進(jìn)行改造。
分享題目:CentOS7.2安裝配置PerconaServer
瀏覽地址:http://m.5511xx.com/article/djjcepg.html


咨詢(xún)
建站咨詢(xún)
