阿里云服务器安装MySQL
centos7安装
安装mysql的yum仓库
执行以下命令:
yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
安装mysql
dnf install mysql-community-server
1.启动MySQL,并查看运行状态
[root@node01 log]# systemctl enable mysqld
[root@node01 log]# systemctl status mysqld
2.查看初始密码:
3.登录MySQL:
[root@node01 log]# mysql -u root -p
4.去掉免密登录:
[root@node01 etc]# vim my.cnf
注释掉:–skip-grant-tables
5.登录进去MySQL,然后刷新:
flush privileges
6.登录MySQL设置密码:
mysql> set password for root@localhost =password("");
这里好像必须是双引号
centos8安装
https://blog.csdn.net/qq_41688840/article/details/104699628
感谢为这篇文章提供帮助的博客