个人比较喜欢 MYSQL 的轻量,今天花了一点时间把阿里云上的 MYSQL5.7 换成了 Percona-Server 。Percona 是一个开源的 MySQL 衍生版,TokuDB 的数据库引擎使得 Percona 服务器非常有吸引力,如果你需要的高性能,高可靠性和高性价比的解决方案,它将是一个很好的选择。

Percona Server 5.7 comes with the TokuDB storage engine. You can find more information on how to install and enable the TokuDB storage in the TokuDB Installation guide.

Installing Percona Server

#测试环境关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm
yum list | grep percona
yum install Percona-Server-server-
#查看 mysql 服务
systemctl restart mysqld.service
systemctl enable mysqld.service
systemctl status mysqld.service
#默认目录
/etc/my.cnf
/var/lib/mysql
/var/log/mysqld.log
#查看mysql初始密码
grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
#开启远程连接
use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;

安全配置(非必须 mysql 官方文档只在 mysql 6.x 版本)

[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:
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!

修改编码(非必须,mysql 8.0 默认 utf8mb4 编码

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
Server version: 5.7.- Percona Server (GPL), Release , Revision 9f0fd0a Copyright (c) - Percona LLC and/or its affiliates
Copyright (c) , , 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 | |
+--------------------------------------+-------------------------------------+
rows in set (0.00 sec)
[mysqld]
...
character_set_server=utf8mb4
collation_server=utf8mb4_0900_ai_ci
skip-character-set-client-handshake
sort_buffer_size=512K

docker 容器运行
https://hub.docker.com/u/percona/
https://www.percona.com/doc/percona-server/LATEST/installation/docker.html

# docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
#yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum install docker-ce
sudo systemctl enable docker && systemctl start docker
sudo docker run hello-world
sudo systemctl status docker # portainer
docker pull portainer/portainer
docker images
docker run -d -p : -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer docker run -d \
--name percona-Server-server- \
-e MYSQL_ROOT_PASSWORD=JUST_PWD \
percona/percona-server:5.7 \
--character-set-server=utf8 \
--collation-server=utf8_general_ci

其他问题

如果下载慢,更换国内源

#国内源
https://mirrors.tuna.tsinghua.edu.cn/percona/release/7/RPMS/x86_64/repodata/
http://mirrors.ustc.edu.cn/percona/release/7/RPMS/x86_64/repodata/ ########################################
# Percona releases and sources, stable #
########################################
[percona-release-$basearch]
name = Percona-Release YUM repository - $basearch
#baseurl = http://repo.percona.com/release/$releasever/RPMS/$basearch
baseurl = https://mirrors.tuna.tsinghua.edu.cn/percona/release/$releasever/RPMS/$basearch
enabled =
gpgcheck =
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Percona

apt


sudo apt update && sudo apt upgrade
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/LATEST/installation.html
https://www.percona.com/doc/percona-server/LATEST/performance/threadpool.html
https://dev.mysql.com/doc/refman/8.0/en/innodb-buffer-pool-resize.html
https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
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
MySQL、Postgres 开启远程访问权限(ubuntu)

http://wenzhixin.net.cn/2012/05/15/mysql_open_the_remote_access_ubuntu

CentOS 7.5 安装与配置 Percona Server 5.7的更多相关文章

  1. openvpn-在Linux中安装和配置OpenVPN Server的最简便方法!(转)

    在Linux中安装和配置OpenVPN Server 出于本文的需要,我将使用两个运行CentOS 7 64位版本的系统.一个充当OpenVPN服务器,另一个充当OpenVPN客户机.下面是测试系统的 ...

  2. 在Linux中安装和配置OpenVPN Server的最简便方法!

    本文介绍了如何在基于RPM和DEB的系统中安装和配置OpenVPN服务器.我们在本文中将使用一个名为openvpn-install的脚本,它使整个OpenVPN服务器的安装和配置过程实现了自动化.该脚 ...

  3. CentOS 7中安装和配置Promethues

    Prometheus 是什么? Prometheus是一套开源的监控&报警&时间序列数据库的组合,起始是由SoundCloud公司开发的.随着发展,越来越多公司和组织接受采用Prome ...

  4. CentOS 下 redis 安装与配置

    CentOS 下 redis 安装与配置   1.到官网上找到合适版本下载解压安装 [root@java src]# wget -c http://redis.googlecode.com/files ...

  5. 环境搭建系列-系统安装之centos 6.5安装与配置

    按照国际惯例,系列目录先奉上: 系列一:系统安装之centos 6.5安装与配置 系列二:准备工作之Java环境安装 系列三:数据为先之MySQL读写集群搭建 系列四:谈分布式之RabbitMQ集群搭 ...

  6. 在CentOS 7中安装与配置Tomcat-8方法

    安装前提 在CentOS 7中安装与配置JDK8 安装tomcat  apache-tomcat-8.0.14.tar.gz文件上传到/usr/local中执行以下操作: [root@localhos ...

  7. 如何在 CentOS 7 中安装、配置和安全加固 FTP 服务

    步骤 1:安装 FTP 服务器 1. 安装 vsftpd 服务器很直接,只要在终端运行下面的命令. # yum install vsftpd 2. 安装完成后,服务先是被禁用的,因此我们需要手动启动, ...

  8. MongoDB 3.2 在CentOS 上的安装和配置

    MongoDB 3.2 在CentOS 上的安装和配置   2016-01-06 14:41:41 发布 您的评价:       0.0   收藏     0收藏 一.安装 编辑/etc/yum.re ...

  9. 在 CentOS 7上安装并配置 Python 3.6 环境

    前言 按照此方法安装保证以下报错什么的统统都没有! 基础环境 系统:centos7.4 软件:python3 Retrying (Retry(total=0, connect=None, read=N ...

随机推荐

  1. vue+大文件分片上传

    最近公司在使用vue做工程项目,实现大文件分片上传. 网上找了一天,发现网上很多代码都存在很多问题,最后终于找到了一个符合要求的项目. 工程如下: 对项目的大文件上传功能做出分析,怎么实现大文件分片上 ...

  2. linux systemctl 常用用法简介

    主要介绍systemctl的几个功能如下: 1.查看某个服务的状态 2.关闭某个服务 3.开启某个服务 4.设置某个为开机自启动 5.关闭某个服务为开机不启动 6.查看所有开启启动的服务 1.查看某个 ...

  3. x86_64汇编调试程序初步

    寄存器说明: rdi 存第1个参数(值或地址) rsi 存第2个参数 rdx 存第3个参数 rcx 存第4个参数 r8 存第5个参数 r9 存第6个参数 rax 第1个返回值 rdx 第2个返回值 r ...

  4. matlab矢量场数值可视化(动态数值模拟)

    https://blog.csdn.net/eric_e/article/details/81294092 D3.js实现数据可视化 三维可视化 风场可视化(数据插值):风场是动态变化的,实时刷新的, ...

  5. PHP与Python哪个做网站产品好?

    虽然python现在比较火,但在传统的LAMP组合里Linux+apache/tomcat+MySql+PHP里是PHP做网站的脚本语言,但现在已经变了:https://baike.baidu.com ...

  6. 机器学习之Apriori算法和FP-growth算法

    1 关联分析 无监督机器学习方法中的关联分析问题.关联分析可以用于回答"哪些商品经常被同时购买?"之类的问题. 2 Apriori算法   频繁项集即出现次数多的数据集   支持度 ...

  7. 【python-字典】判断python字典中key是否存在的

    一般有两种通用做法: 第一种方法:使用自带函数实现: 在python的字典的属性方法里面有一个has_key()方法: #生成一个字典 d = {'name':Tom, 'age':10, 'Tel' ...

  8. Swift3 今日(TodayExtension)扩展图文笔记

    >图片1(创建今日扩展) >图片2  >图片3(设置大小)  >图片4(绘画控件) >图片5(设置共享文件)  >图片6(设置群组ID) >图片7(设置URL ...

  9. 应该知道的Linux技巧【转】

    这篇文章来源于Quroa的一个问答<What are some time-saving tips that every Linux user should know?>—— Linux用户 ...

  10. 搭建ELK集群

    环境准备 基础环境介绍 操作系统 部署应用 应用版本号 IP地址 主机名 CentOS 7.4 Elasticsearch/Logstash 6.4.3 192.168.1.1 elk1 CentOS ...