Ubuntu 14.10 下MySQL无法远程连接问题
2015-04-16 10:59
531 查看
安装好MySQL之后,如果需要远程连接,那么需要做一些配置,否则会出现一些类似的错误,如
1 当MySQL 连接服务器时发生”Can not connect to mysql error 10061”错误
将/etc/mysql/my.conf文件中的bind-address选项设置为MySQL服务器的IP,默认为127.0.0.1。
然后sudo /etc/init.d/mysql restart --重启服务
2 当MySQL 连接服务器时发生”is not allowed to connect to this MySQL server”错误
将MySQL数据库中的user表中的host列的localhost为%
3 此时没有127.0.0.1和localhost主机,所以无法用root用户进行连接,会提示以下错误
则此时只能用系统自带的debian-sys-maint用户登录,给root用户赋予新的权限。debian-sys-maint用户的的登录密码在/etc/mysql/debian.cnf中明文显示。
4 如果不想root用户被远程登录,可以新建用户
mysql root用户ERROR 1045 (28000): mysql 远程登录 ERROR 1045 (28000) mysql 远程登录2003 Can not connect to mysql error 10061
1 当MySQL 连接服务器时发生”Can not connect to mysql error 10061”错误
将/etc/mysql/my.conf文件中的bind-address选项设置为MySQL服务器的IP,默认为127.0.0.1。
然后sudo /etc/init.d/mysql restart --重启服务
2 当MySQL 连接服务器时发生”is not allowed to connect to this MySQL server”错误
将MySQL数据库中的user表中的host列的localhost为%
delete from user where user='root' and host <> '%'; -- 删除多余用户 update user set host ='%' where host='localhost' and user='root'; --更新host select host,user,password from user;
+-----------+------------------+-------------------------------------------+ | host | user | password | +-----------+------------------+-------------------------------------------+ | localhost | debian-sys-maint | *3B3724AE1051D0628525347DAC3635A6C523F944 | | % | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | | % | hive | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC | +-----------+------------------+-------------------------------------------+
3 此时没有127.0.0.1和localhost主机,所以无法用root用户进行连接,会提示以下错误
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
则此时只能用系统自带的debian-sys-maint用户登录,给root用户赋予新的权限。debian-sys-maint用户的的登录密码在/etc/mysql/debian.cnf中明文显示。
grant all on *.* to root@'%' identified by 'user_password';
4 如果不想root用户被远程登录,可以新建用户
mysql -u root -p insert into user(Host,User,Password) values("%","hive",password("hive")); FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%' IDENTIFIED BY 'hive'; FLUSH PRIVILEGES;
相关文章推荐
- 亚马逊EC2 ubuntu下安装mysql远程无法连接问题o
- Ubuntu mysql 不能远程连接的问题 (转载)
- 远程客户端无法连接ubuntu下Mysql
- Ubuntu无法ssh远程连接问题
- Mysql用户无法远程连接问题
- 树莓派学习笔记1 -- 解决mysql无法远程连接问题
- Ubuntu远程连接MySQL, 10038问题
- 新安装的mysql无法远程连接问题
- mysql远程无法连接数据库的问题
- 解决ubuntu下mysql不能远程连接数据库的问题
- 【数据库】LNMP一键包安装后解决MySQL无法远程连接问题
- ubuntu安装mysql后无法远程连接解决方案
- ubuntu 下无法远程连接Mysql处理
- CentOS6.5下MySQL无法远程连接的问题
- windows版本的mysql无法远程连接服务器上的mysql的问题,错误代码10060
- Navicat远程无法连接mysql问题解决(附MAC上NavicatPremium11.1.8破解中文版下载链接)
- 【MySQL错误系列】本地无法远程连接阿里云Ubuntu环境下Mysql数据库cant connect to mysql server on …..(10061)
- Ubuntu Server 中MySQL无法远程连接?
- ubuntu 使用 远程桌面软件 Remmina 时遇到“无法连接到服务器”问题
- ssh远程无法连接VM中的Ubuntu问题