linux下安装mysql(rpm安装)Mysql 5.7.29安装步骤
1、⾸先卸载⾃带的Mysql-libs(如果之前安装过mysql,要全都卸载掉)
rpm -qa | grep -i -E mysql\|mariadb | xargs -n1 sudo rpm -e --nodeps
2、mysql 5.7.29.rpm安装包上传到linux服务器上
mysql 5.7.29 安装包阿⾥云盘()
01_mysql-community-common-5.7.29-1.el7.x86_64.rpm
02_mysql-community-libs-5.7.29-1.el7.x86_64.rpm
03_mysql-community-libs-compat-5.7.29-1.el7.x86_64.rpm
04_mysql-community-client-5.7.29-1.el7.x86_64.rpm
05_mysql-community-server-5.7.29-1.el7.x86_64.rpm
3、安装MySql
(1) 安装 mysql 依赖
sudo rpm -ivh 01_mysql-community-common-5.7.29-1.el7.x86_64.rpm
sudo rpm -ivh 02_mysql-community-libs-5.7.29-1.el7.x86_64.rpm
sudo rpm -ivh 03_mysql-community-libs-compat-5.7.29-1.el7.x86_64.rpm
(2) 安装mysql-client
sudo rpm -ivh 04_mysql-community-client-5.7.29-1.el7.x86_64.rpm
(3) 安装mysql-server
sudo rpm -ivh 05_mysql-community-server-5.7.29-1.el7.x86_64.rpm
(4) 启动mysql
sudo systemctl start mysqld
(5) 查看mysql密码
sudo cat /var/log/mysqld.log | grep password
4、配置Mysql
配置只要是root⽤户+密码,在任何主机上都能登录MySQL数据库。
在linux中下载mysql时冲突是什么
(1) ⽤刚刚查到的密码进⼊mysql(如果报错,给密码加单引号)
mysql -uroot -p’password’
(2) 设置复杂密码(由于mysql密码策略,此密码必须⾜够复杂)
mysql> set password=password("Qs23=zs32");
(3) 更改mysql密码策略
mysql> set global validate_password_length=4;
mysql> set global validate_password_policy=0;
(4) 设置简单好记的密码
mysql> set password=password("000000");
(5) 进⼊msyql库
mysql> use mysql
(6) 查询user表
mysql> select user, host from user;
(7) 修改user表,把Host表内容修改为%
mysql> update user set host="%" where user="root";
(8) 刷新
mysql> flush privileges;
(9) 退出mysql> quit; 5、安装成功

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。