时间:2021-07-01 10:21:17 帮助过:43人阅读
7. 修改默认密码:
[root@izwz91qnvovd6suufon1ccz ~]# mysql -u root -p Enter password: --使用上面的密码进入mysql mysql> set password = password(‘yourpassword‘);
Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> alter user ‘root‘@‘localhost‘ password expire never; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> quit; --退出后再使用密码登陆
8. 赋远程访问权限:
mysql> grant all privileges on *.* to ‘root‘@‘%‘ IDENTIFIED BY ‘yourpassword‘ WITH GRANT OPTION; Query OK, 0 rows affected, 1 warning (0.00 sec)
9. 看下防火墙:
[root@izwz91qnvovd6suufon1ccz ~]# firewall-cmd --list-all
FirewallD is not running
10. 我这里防火墙没有运行直接可以使用navicat远程访问了, 默认端口3306
11. 关于防火墙:
1. 查看防火墙 firewall-cmd --list-all 2. 加入3306端口 firewall-cmd --permanent --add-port=3306/tcp 3. 重启防火墙 service firewalld restart 4. 查看3306是否开放 firewall-cmd --query-port=3306/tcp ----------------------------------------------------------- 5. 查看防火墙状态 systemctl status firewalld.service 6. 关闭防火墙 systemctl stop firewalld.service 7. 启动防火墙 systemctl start firewalld 8. 开机禁用防火墙 systemctl disable firewalld 9. 开机启用防火墙 systemctl enable firewalld
20191209_Centos7.2使用yum安装mysql
标签:col 禁用 firewalld generate ase 运行 完成 rate get