作者:吳業亮雲計算開發工程師 博客:http://blog.csdn.net/wylfengyujiancheng
在openstack集群非常大的情況下mysql5.5的最大連接數就成了問題(1040,Too many connections),dashboard界面操作經常因為連接不 上數據庫報各種錯誤。經過試驗將最大連接數改為2000,超時時間改為300s,問題還依舊。 針對這種問題,Percona 推出了新版本Percona 5.7.10-1 具體參見 https://www.percona.com/doc/percona-server/5.7/reliability/log_connection_error.html
下面具體介紹Percona 5.7.10-1安裝方法 1、安裝數據庫源
# yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
2、安裝Percona 5.7
# yum install Percona-Server-server-57
3、啟動數據庫並設置開機啟動
# service mysqld restart
# chkconfig mysqld on
4、初始化數據庫
[root@localhost Percona-db]# mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:
The existing password for the user account root has expired. Please set a new password.
New password:
Re-enter new password:
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) : y
New password:
Re-enter new password:
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
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) : y
Success.
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!
注意:Percona 5.7安裝完默認會產生個隨機的密碼,存在日志中。這個問題曾困擾我一下午。 查看方法:
# cat /var/log/mysqld.log | grep "A temporary password" | awk -F " " '{print$11}'
5、測試
[root@localhost ~]# mysql -uroot -pChangeme_123
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 12
Server version: 5.7.11-4 Percona Server (GPL), Release 4, Revision 5c940e1
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>
mysql>
mysql>
參考: https://www.percona.com
暑期編程PK賽
得CSDN機械鍵盤等精美禮品!