1.linux系统下mysql跳过密码验证登录和创建新用户
1.vim /etc/my.cnf //打开配置文件
2.在[mysqld]的段中加上一句:skip-grant-tables
3.:wq保存退出 systemctl restart mysqld //重启mysql
4.就可以直接进mysql了 然后进去修改密码,改完flush privileges; //刷新MySQL的系统权限
5.在将刚才在[mysqld]的段中加上的skip-grant-tables删除 最后再重启mysql
2.【mysql】You must reset your password using ALTER USER statement before executing this statement.
操作前你必须重置密码: 操作指令 alter user user() identified by '密码';
密码:'默认是8位 ,包含大小写数字特殊符号',不然回报下面这个密码策略错误问题
Your password does not satisfy the current policy requirements //您的密码不满足当前策略的要求
3.ERROR 1130: Host '192.168.1.3' is not allowed to connect to thisMySQL serve
不让远程连接 被连接的数据不允许使用 192.168.1.3访问,只允许是用 localhost;
处理方法:
总体运行语句:
mysql -u root -p //登录
mysql>use mysql; //打开mysql数据库
mysql>select 'host' from user where user='root'; //查看host
mysql>update user set host = '%' where user ='root'; //修改host% 所有都能访问
mysql>flush privileges; //刷新MySQL的系统权限
mysql>select 'host' from user where user='root';
4.开放mysql权限
grant all on *.* to 'root'@'%' identified by 'root';
5.阿里服务器网络添加入口3306端口