本文记录 2019 年的 CentOS 7 与 MySQL 5.7.27 安装过程,仅供维护历史环境时参考。新项目请根据当前系统与数据库版本的官方文档安装。
1. 下载mysql bundle.tar包
上传 mysql bundle.tar包到服务器解压 tar -xvf mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar
2. 按顺序逐个安装rpm
rpm -qa|grep mariadb |
3. 启动&配置
启动 |
4. 进入mysql
执行完如下命令之后输入默认密码mysql -u root -p
MySQL 5调整密码验证规则:set global validate_password_policy=0;
set global validate_password_length=1;
重新设置密码ALTER USER user() identified by "123456";
授权 root 远程连接use mysql;
修改连接权限,执行:update user set host='%' where user ='root';
执行刷新权限:flush privileges;