-欢迎带本文链接进行转载:https://www.jianshu.com/p/a4c1daaffb58
环境:
- 操作系统:阿里云服务器Centos 7
- 软件版本:Percona-Server-5.7.23
注意:安装之前请检查机器中是否已经存在mysql,如果存在,则安装会冲突出错,彻底删除mysql链接:https://www.jianshu.com/p/8130ba0f25bb
1.下载软件之后上传到服务器,可通过xftp或者其他工具
- 软件链接: https://pan.baidu.com/s/14tilBrBtgHBbqcLe3UPHfg 提取码: qryk
2.解压压缩包到指定文件夹,可随意指定
tar -xvf Percona-Server-5.7.23-23-r500fcf5-el7-x86_64-bundle.tar -C /home/software/mysql/
3.卸载废弃的依赖包
yum remove mariadb*
4.进入到解压目录进行rpm安装,注意顺序不能乱
cd /home/software/mysql
rpm -ivh Percona-Server-57-debuginfo-5.7.23-23.1.el7.x86_64.rpm
rpm -ivh Percona-Server-shared-compat-57-5.7.23-23.1.el7.x86_64.rpm
rpm -ivh Percona-Server-shared-57-5.7.23-23.1.el7.x86_64.rpm
rpm -ivh Percona-Server-client-57-5.7.23-23.1.el7.x86_64.rpm
rpm -ivh Percona-Server-server-57-5.7.23-23.1.el7.x86_64.rpm
5.启动MySQL服务
service mysqld start
6.修改默认密码
- 1 查看默认密码
cat /var/log/mysqld.log | grep "A temporary password" | awk -F " " '{print$11}'
- 2 使用默认密码登录
mysql -u root -p
- 3 登录成功之后,设置两个全局参数
- 首先,修改validate_password_policy参数的值
mysql> set global validate_password_policy=0;- 再修改密码的长度
mysql> set global validate_password_length=1;
- 4 执行修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
网友评论