SELECT @@VERSION
查看 MySQL Server 是不是监听了 3306 端口 netstat -ntlp
查看是否可以ping通服务器端口 telnet *.*.*.* 3307
查看mysql端口 show variables like 'port';
修改密码 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
查看是否打开备份 show variables like 'log_bin%';
忘了密码
修改/etc/my.cnf
[mysqld]
skip-grant-tables之后重启mysql service mysqld restart
登陆 mysql -uroot
刷新权限 flush privileges
#创建账户
create user 'root'@'172.16.10.203' identified by 'password'#赋予权限,with grant option这个选项表示该用户可以将自己拥有的权限授权给别人
grant all privileges on *.* to 'root'@'172.16.10.203' with grant option#改密码&授权超用户,flush privileges 命令本质上的作用是将当前user和privilige表中的用户信息/权限设置从mysql库(MySQL数据库的内置库)中提取到内存里
flush privileges;
不过要把最开始的配置文件恢复:
vim /etc/my.cnf
删除配置文件中的:
skip-grant-tables
退出,重启mysql:
systemctl restart mysqld.service