- 先进入root 权限 su root, 防止后续操作有因为权限不够报错
- 如果上次安装有误需重装,先查找
- 删除
- 下载
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
- 安装rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
- 安装mysql
yum -y install mysql-community-server
- 上一步若出现
Unable to find a match: mysql-community-server, 则 yum module disable mysql
- 启动服务
systemctl start mysqld.service
- 查看运行状态
- 查看初始密码
grep 'password' /var/log/mysqld.log
- 进入数据库
- 切换数据库
- 改密码
update user set authentication_string=password('root') where user='root';
- 若前面步骤密码无法登陆,进入这个文件
find / -name my.cnf, 然后在【mysqld】 内增加 skip-grant-tables, 可免密
posted @
2022-04-19 19:10
.前端实习生
阅读(
40)
评论()
收藏
举报