1.wget下载安装用的Yum Repository
[root@localhost ~]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
2.安装
[root@localhost ~]# yum -y install mysql57-community-release-el7-10.noarch.rpm
3.安装MySQL服务器
[root@localhost ~]# yum -y install mysql-community-server
4.启动mysql
[root@localhost ~]# systemctl start mysqld.service
5.
查看MySQL运行状态,运行状态如图:
[root@localhost ~]# systemctl status mysqld.servic
5.设置密码
[root@localhost ~]# grep "password" /var/log/mysqld.log
如下命令进入数据库
[root@localhost ~]# mysql -uroot -p
下面两步是为了可以设置简单的密码
- mysql> set global validate_password_policy=0;
- mysql> set global validate_password_length=1;
修改密码
mysql> set password for 'root'@'localhost'= password('简单密码');
6.设置远程访问用户
1.mysql>grant all privileges on *.* to '用户名' @'%' identified by '密码';
2.flush privileges;
远程登录mysql就用上面的 ‘用户名‘,’密码‘
https://blog.csdn.net/qq_37598011/article/details/93489404
卸载MySQL:https://www.cnblogs.com/nicknailo/articles/8563456.html