mysql远程连接 Host * is not allowed to connect to this MySQL server
来源:互联网 发布:天津基础教研网络平台 编辑:程序博客网 时间:2024/06/07 01:25
localhost改成%
进入mysql的BIN目录
代码如下复制代码mysql -u root -p
mysql>use mysql;
mysql>update user set host =’%'where user =’root’;
mysql>flush privileges;
具体分析
1、在本机登入mysql后,更改“mysql”数据库里的“user”表里的“host”项,从”localhost”改为'%'。
代码如下复制代码mysql>mysql>use mysql;
mysql>select 'host' from user where user='root';
#查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)
代码如下复制代码mysql>update user set host = '%' where user ='root';#修改host值(以通配符%的内容增加主机/IP地址,当然也可以直接增加某个特定IP地址,如果执行update语句时出现ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 错误,需要select host from user where user = 'root';
查看一下host是否已经有了%这个值,如果有了直接执行下面的flush privileges;即可)
mysql>flush privileges;
mysql>select host,user from user where user='root';
mysql>quit
安装好mysql后修改密码发生:#1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client 错误。
原因:
升级客户端
新版本的mysql使用了新的密码验证方法
设置mysql密码时使用old_password可以解决这个问题
解决方法如下:
方法一:
mysql> SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('新密码');
方法二:
mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('新密码')
-> WHERE Host = 'some_host' AND User = 'some_user';
mysql> FLUSH PRIVILEGES;
注:
some_user:表示当前出错的用户ID,例如:root;
some_host:表示当前主机,例如:localhost;
Mysql Docker下载地址
docker run -i -t -d -p 3306:3306 -p 8080:80 d5127813070b /bin/bash
mysql应用在/var/lib/mysql下
mysql> use mysql;
mysql> update user set password=password('123') where user='root' and host='localhost';
mysql> flush privileges;
update user set host ='%'where user ='root';
方法1: 用SET PASSWORD命令
首先登录MySQL。
格式:mysql> set password for 用户名@localhost = password('新密码');
例子:mysql> set password for root@localhost = password('123');
方法2:用mysqladmin
格式:mysqladmin -u用户名 -p旧密码 password 新密码
例子:mysqladmin -uroot -p123456 password 123
方法3:用UPDATE直接编辑user表
首先登录MySQL。
mysql> use mysql;
mysql> update user set password=password('123') where user='root' and host='localhost';
mysql> flush privileges;
- Mysql 远程连接错误:1130-host IP is not allowed to connect to this MySql server
- 远程连接MYSQL提示Host is not allowed to connect to this MySQL server
- 远程连接MYSQL提示Host is not allowed to connect to this MySQL server(...
- 远程连接MYSQL 错:1130-host ... is not allowed to connect to this MySql server
- 远程连接MYSQL提示Host is not allowed to connect to this MySQL server
- 远程连接MYSQL提示Host is not allowed to connect to this MySQL server(转)
- 远程连接mysql 出现: 1130: Host is not allowed to connect to this MySQL server 解决
- mysql远程连接 Host * is not allowed to connect to this MySQL server问题解决方法
- mysql远程连接 Host * is not allowed to connect to this MySQL server
- mysql远程连接错误1130-host ... is not allowed to connect to this MySql server
- MySQL远程连接:Host 'x' is not allowed to connect to this MySQL server
- mysql远程连接 Host * is not allowed to connect to this MySQL server
- host ... is not allowed to connect to this MySql server 开放mysql远程连接
- mysql远程连接 Host * is not allowed to connect to this MySQL server
- 远程连接MYSQL提示Host is not allowed to connect to this MySQL server
- mysql远程连接报错: Host * is not allowed to connect to this MySQL server,解决方法
- MySQL远程连接报错:Host is not allowed to connect to this MySQL server
- mysql远程连接 Host * is not allowed to connect to this MySQL server
- 关于Flex 布局。
- 一铭server7运行自动化测试(ltp, audittest)
- 2016-2017前端面试题
- linux下.bashrc文件修改和生效
- Spring的各个模块与导包原则
- mysql远程连接 Host * is not allowed to connect to this MySQL server
- Web Services学习
- DFT
- Easy 10 Search Insert Position(35)
- POSIT算法原理---opencv 3D姿态估计
- Centos挂载NTFS格式的文件系统
- GAT项目新需求:加油管理修改
- 网络编程基础
- 使用ueditor在服务器图片路径显示不正确,多了斜杠