远程连接ubuntu mysql出现2003错误 cant connect to mysql
来源:互联网 发布:0.32双丝并绕数据 编辑:程序博客网 时间:2024/06/08 02:52
1.在控制台输入,进入MySQL目录下,
- 1
- 2
- 1
- 2
2.打开my.cnf文件,找到 bind-address = 127.0.0.1 在前面加上#注释掉,如下:
#bind-address = 127.0.0.1
3.然后在添加如下代码;OK。
- 1
- 2
- 1
- 2
若在my.cnf文件中找不到#bind-address = 127.0.0.1 如图所示:
那么进入 第二个路径 /etc/mysql/mysql.conf.d/ 文件夹中打开 mysqld.cnf文件修改即可。
4.重新启动mysql服务
- 1
- 2
- 1
- 2
顺便在跟大家说一下连接时遇到 is not allowed to connect to this MySQL server 错误的解决方法;
1.在控制台输入 mysql -uroot -p密码 进入mysql
(2.输入 use mysql; 进入mysql数据库
3.输入 update user set host=’%’ where user=’root’ ; 来允许通过ip访问。)注意:括号中的方法是允许所有人连接,容易被别人黑,所以要设置指定IP访问。具体方法如下:
直接输入 :
- 1
- 1
也可以先更新将host更新为% ,然后通过图形化界面(SqlYog, workbench 等)来更新host为自己的ip。
4.继续输入 flush privileges; 记住,不管选用上面那种方法,都要执行这步来更新数据库用户权限。非常重要!!!
5.然后重新连接,这样问题就解决了。
阅读全文
0 0
- 远程连接ubuntu mysql出现2003错误 cant connect to mysql
- 远程连接ubuntu mysql出现2003错误 cant connect to mysql
- 远程连接ubuntu mysql出现2003错误 cant connect to mysql
- 远程连接ubuntu mysql出现2003错误 cant connect to mysql
- 使用sqlyog远程连接mysql错误2003 cant connect to mysql 10060/10061解决方法
- 使用sqlyog远程连接mysql错误2003 cant connect to mysql 解决办法
- 使用sqlyog远程连接mysql 错误2003 cant connect to mysql 10060/10061 解决方法最强合集
- mysql 出现2003- cant connect to MYSQL server on localhost 的错误
- MySQL 错误:cant't connect to MySQL server (10060)
- mysql 出现2003- cant connect to MYSQL server on localhost 的解决办法
- MySQL错误号码2003 Cant connect to MySQL server localhost 0
- 2003 cant connect to MySQL server on 'localhost'(10061)
- error 2003 cant connect to mysql server on localhost 10061
- 远程连接mysql 出现: 1130: Host is not allowed to connect to this MySQL server 解决
- 远程连接MySQL出现host is not allowed to connect to this mysql server
- Mysql 远程连接错误:1130-host IP is not allowed to connect to this MySql server
- mysql远程连接错误1130-host ... is not allowed to connect to this MySql server
- cant't connect to MySQL server on 'localhost' (10061) (发生系统错误1067)
- AndroidStudio布局
- PythonNewHere-Python开发环境搭建(windows)
- servlet
- 629. K Inverse Pairs Array
- 快学scala之数组操作
- 远程连接ubuntu mysql出现2003错误 cant connect to mysql
- Fastjson toJSONString用单引号进行转换
- Leetcode596. Classes More Than 5 Students
- angularjs input 表单校验指令整理
- 使用@ResponseBody的中文乱码问题
- Dom 倒计时按钮
- Leetcode197. Rising Temperature
- webpack安装与基本配置
- NKOJ-1887 借教室 【NOIP2012 day2】