1.去除centOS中默认带的数据库
yum remove mariadb-libs.x86_64
2.下载源
mkdir -p temp && cd temp //下载的文件 放置的位置
wget https://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
yum localinstall mysql57-community-release-el7-8.noarch.rpm //安装本地的源文件
3.安装mysql
yum install mysql-community-server
4.查看初始化密码
cat /var/log/mysqld.log | grep "password"
5.启动和登录
service mysqld start
// ps -ef |grep mysql (查看启动的服务)
mysql -uroot -p
exit // 退出
6.修改密码
mysql> set password for 用户名@localhost = password(‘新密码’);
//注意:mysql 对密码有安全性与复杂性的校验,所以密码太简单会不通过
// Your password does not satisfy the current policy requirements
本地连接
- 下载Navicat 安装
Navicat 链接到 mysql
https://blog.csdn.net/homewm/article/details/81316852
网友评论