个人比较喜欢 MYSQL 的轻量,今天花了一点时间把阿里云上的 MYSQL5.7 换成了 Percona-Server ,Percona 是一个开源的 MySQL 衍生版。InnoDB的数据库引擎使得 Percona 服务器非常有吸引力,如果你需要的高性能,高可靠性和高性价比的解决方案,它将是一个很好的选择。
安装
#安装 YUM 源
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
#测试 YUM 源是否生效
yum list | grep percona
#安装 Percona-Server
yum install Percona-Server-server-57 Percona-Server-client-57
#启动服务
service mysqld start
#登录 MySQL
mysql -u root -p

mysql5.7.x 安装完成后会初始化一个 root 用户的随机密码,在 /var/log/mysqld.log 日志中可以查看到,也可以通过命令查找

[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 服务
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)

#开启启动服务
systemctl enable mysqld.service

#关闭防火墙
systemctl stop firewalld.service #停止
systemctl disable firewalld.service #禁用

#开启远程连接
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.

#允许ubuntu下mysql远程连接

vi /etc/mysql/percona-server.conf.d/mysqld.cnf
注释#bind-address = 127.0.0.1

授权用户能进行远程连接

grant all privileges on *.* to root@"%" identified by "password" with grant option;

flush privileges;

sudo service mysql restart

update
update 是同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,这样才能获取到最新的软件包。
upgrade
upgrade 是升级已安装的所有软件包,升级之后的版本就是本地索引里的,因此,在执行 upgrade 之前一定要执行 update, 这样才能是最新的。
An update should always be performed before an upgrade or dist-upgrade.
upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded.

REFER:
https://www.percona.com/doc/percona-server/5.7/installation/yum_repo.html
https://www.percona.com/doc/percona-server/5.7/installation/apt_repo.html
为什么我不再看好MariaDB
http://www.innomysql.com/article/25821.html

CentOS 7.2 安装配置 Percona Server的更多相关文章

  1. CentOS 6.6安装配置LAMP服务器(Apache+PHP5+MySQL)

    准备篇: CentOS 6.6系统安装配置图解教程 http://www.osyunwei.com/archives/8398.html 1.配置防火墙,开启80端口.3306端口 vi /etc/s ...

  2. CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL)

    CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL) 一.准备篇: /etc/init.d/iptables stop #关闭防火墙 关闭SELINUX vi /etc/sel ...

  3. CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)

    这篇文章主要介绍了CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)的方法,需要的朋友可以参考下 文章写的不错,很详细:IDO转载自网络: 准备篇: 1.配置防火墙,开启 ...

  4. CentOS 6.3安装配置LAMP服务器(Apache+PHP5+MySQL)

    准备篇: 1.配置防火墙,开启80端口.3306端口 vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp -- ...

  5. CentOS 6.5安装配置LAMP服务器(Apache+PHP5+MySQL)的方法

    CentOS 6.5安装配置LAMP服务器(Apache+PHP5+MySQL)的方法 准备篇: 1.配置防火墙,开启80端口.3306端口vi /etc/sysconfig/iptables-A I ...

  6. CentOS 6.4安装配置LAMP服务器

    CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL) 作者: 字体:[增加 减小] 类型:转载 这篇文章主要介绍了CentOS 6.4安装配置LAMP服务器(Apache+ ...

  7. centos tomcat/resin安装配置 卸载系统自带的java tomcat安装配置 安装JDK resin安装配置 第二十八节课

    centos  tomcat/resin安装配置  卸载系统自带的java  tomcat安装配置  安装JDK   resin安装配置    第二十八节课 tomcat和java都不需要编译 tom ...

  8. CentOS 6.4安装配置ldap

    CentOS 6.5安装配置ldap 时间:2015-07-14 00:54来源:blog.51cto.com 作者:"ly36843运维" 博客 举报 点击:274次 一.安装l ...

  9. CentOS 6.3安装配置LAMP服务器(Linux+Apache+MySQL+PHP5)

    服务器系统环境:CentOS 6.3 客户端系统环境:Windows 7 ultimate(x86)sp1 简体中文旗舰版 ※  本文档描述了如何在Linux服务器配置Apache.Mysql.PHP ...

随机推荐

  1. App技术框架

    一.App技术框架的类型 图1 三种App技术框架之间的关系 目前App的技术框架基本分为三种(图1): (1)Native App:互动型,iOS.Android.WP各一套,而且要维护历史版本,要 ...

  2. poj 3635/hdu 1676 Full Tank? 车辆加油+最短路

    http://acm.hdu.edu.cn/showproblem.php?pid=1676 给出一张图,n<=1000,m<=10000. 有一辆车想从图的一个地方到达另外一个地方,每个 ...

  3. 采用动态代理方式调用WEB服务(转载+整理)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  4. C++11 并发指南后续更新

    C++11 并发指南的第一篇是 2013 年 8 月 3 号写的,到今天(2013 年 8 月 31 号)差不多一个月了,前前后后共写了 6 章(目前共 8 篇)博客介绍 C++11 的并发编程,但还 ...

  5. 记一次在StackOverFlow上问问题的经历

    最近一直在做测试方面的事情,被测的一些功能需要连接到FTP服务器上.而我在做本地测试时为了方便,就使用java写了一个简单的ftp服务器,可以在命令行下直接启动运行. 当时在main函数里是这样写的. ...

  6. Entity Framework问题总结

    Entity Framework WITH(NOLOCK) EF本身不支持WITH(NOLOCK), 都指出建议设置事务的级别为允许脏读. IsolationLevel = IsolationLeve ...

  7. 【转】关于Mahalanobis距离的笔记

    Mahalanobis距离是用来度量一个点P和一个分布D之间的距离,它是衡量点P与分布D的均值之间存在多少个标准差的一个多维泛化版本. 如果P就位于分布D的均值处,则该距离为0:该距离随着P的偏离均值 ...

  8. atitit.j2ee 1.5 1.6 的不同跟 Servlet 3.0新特性总结

    atitit.j2ee 1.5 1.6 的不同跟 Servlet 3.0新特性总结 1. jar比较,j2ee 1.6 添加了许多的jar 1 2. ,Servlet 3.0 2 2.1. 可插性   ...

  9. paip.输入法英文词库的处理 python 代码 o4

    paip.输入法英文词库的处理 python 代码 o4 目标是eng>>>中文>>atian 当输入非atian词的时候儿,能打印出 atian pinyin > ...

  10. 菜鸟日记-HTML-表格与表单

    一.表格 <table></table> width:宽度.可以用像素或百分比表示. border:边框,常用值0 cellpadding:内容跟单元格边框的边距.常用值0 a ...