`
瓜田守望者
  • 浏览: 144485 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
文章分类
社区版块
存档分类
最新评论

Connection to mysql server on 10065 解决办法

阅读更多

远程访问linux上 的mysql一直不行,一直报 error  2003 : connection to mysql server  on 10065 我是用的 Navicat for MySQL 登陆的

 

1.

修改方式1代码
改表法。  
可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" 
mysql -u root -p123  
mysql>use mysql;  
mysql>update user set host = '%' where user = 'root'; 

改表法。
可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -p123
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
 

2. 进入mysql 授予表 数据库 权限

 

修改二代码
 授权法。例如,你想 Ufinity 
使用mypassword从任何主机连接到mysql服务器的话。  
GRANT ALL PRIVILEGES ON *.* TO 'test'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;  
要及时生效 : FLUSH PRIVILEGES  
如果你想允许用户kevin从ip为192.168.1.139的主机连接到mysql服务器,并使用mypassword作为密码   
GRANT ALL PRIVILEGES ON *.* TO 'test'@'192.168.1.129' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 

 

3. 防火墙

最后方法代码
//关闭防火墙    
service iptables stop  

 

 

小结 :

其实1,2都是为了在mysql 的 mysql数据库中的 user表 里面有这样的记录

Sql代码
select Host ,User from user where User ='root' and Host ='%';  

select Host ,User from user where User ='root' and Host ='%';  +------+------+
| Host | User |
+------+------+
| %    | root |
+------+------+

 

意思是 以root 用户登陆 ,在局域网 中 所有的其他主机上都可以访问

 

最后实在不行 关闭防火墙。

 

分享到:
评论

相关推荐

    解决Navicat远程服务器2013-Lost connection to MYSQL server at ‘waitting for initial communication packet’

    使用Navicat远程服务器mysql数据库时报错误:2013-Lost connection to MYSQL server at ‘waitting for initial communication packet’,system error:0 操作流程一、检验Mysql数据库是否安装成功二、对Mysql的配置...

    mysql安装失败

    The security settings could not be applied to the database because the connection has failed with the following error. Error Nr. 1045 Access denied for user 'root'@'localhost' (using password: YES) ...

    nrpe监控mysql.docx

    nagios监控mysql服务器: 1、建立专用数据库: [root@svr3 ~]# /usr/local/webserver/mysql/bin...mysql> grant select on nagios.* to nagios@'%' identified by '123qweasd'; Query OK, 0 rows affected (0.00 sec)

    mysql-8.0.20-macos10.15-x86_64.tar.gz

    解决办法: mysql> use mysql; mysql> alter user 'root'@'localhost' identified with mysql_native_password by '12345678'; mysql> flush privileges; 如上即可。 加入环境变量,编辑 /etc/profile,这样可以...

    mysql-connector-java-commercial-5.1.30-bin.jar

    命令:grant all privileges on first.* to test@localhost identified by “123456”; 当你执行完这个命令以后,只要你再以用户名:test,密码:123456登录时你就只可以对first这个数据库操作,这样避开使用root ...

    Mysql基础面试题及答案大全

    问题1:你如何确定 MySQL 是否处于运⾏状态? 答案: Debian 上运⾏命令 service mysql status,在RedHat 上运⾏命令 service mysqld status。然后看看输出即可。 root@localhost:/home/avi# service mysql status /...

    unidac+3.0.010 各种数据库连接

    We have joined the experience of long-term successful development into one great product which provides unified access to popular databases such as Oracle, Microsoft SQL Server, MySQL, InterBase, ...

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

    mysql中的跨库关联查询方法

    业务场景:关联不同数据库中的表的查询 比如说,要关联的表是:机器A上的数据库A中的表A && 机器B上的数据库B中的表B。...CREATE TABLE `table_name`(......) ENGINE =FEDERATED CONNECTION='mysql://

    PHP and MySQL Web Devepopment 4th Edition.pdf

    each of the two facilities would typically be configured to act as its own site since the computers within the facility are on a common LAN, but there is no LAN connection between the facilities....

    MySQL关闭密码强度验证功能

    [root@mysql mysql]# mysql -uroot -...Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.18 Copyright (c) 2000, 2017, Oracle and/or its affiliates.

    ByteFX.MySqlClient.76.NI

    This should speed up operations on multiple rows with blobs * Fixed bug where connecting to a down or non-existent server would not timeout * Improved connection string handling. Now if there...

    游戏网站PHPMysql设计和实现--计算机专业.doc

    so the state of the database is very important.In this article, the Mysql database server is selected as the back-end database, which facilitates the close connection between the Web and the database...

    unidac5.3.8src

    Bug with connection establishing when Pooling is enabled is fixed for MySQL provider Bug with RefreshRecord when ReadOnly is set to True is fixed for MySQL provider Bug with SSL connection on ...

    php.ini-development

    interesting side-effects depending on your application and web server. ; You may be able to send headers and cookies after you've already sent output ; through print or echo. You also may see ...

    Devart UniDAC v5.3.8 Source

    -Bug with connection establishing when Pooling is enabled is fixed for MySQL provider -Bug with RefreshRecord when ReadOnly is set to True is fixed for MySQL provider -Bug with SSL connection on ...

    Devart_UniDAC_6.3.13_for_XE8

    Bug with AV on connection lost is fixed Bug with the incorrect milliseconds part of timestamp fields is fixed DBF data provider Direct mode is supported Beta NexusDB data provider NexusDB 4.1 is ...

    Devart_UniDAC_6.3.13_for_DX10.1

    Bug with AV on connection lost is fixed Bug with the incorrect milliseconds part of timestamp fields is fixed DBF data provider Direct mode is supported Beta NexusDB data provider NexusDB 4.1 is ...

    基于MySQL的数据库中间件Meituan-DBProxy.zip

    增加后台MySQL版本号设置,主要影响MySQL连接协议中的server版本,客户端驱动可能依赖于server版本处理机制有所不同。由参数mysql-version控制 性能改进,将SQL词法分析从串行方式改进为并发方式;其次,...

    DevArt UniDAC v.3.70.0.18 (15-Jun-2011) (with Source Code)

    Bug with the "BAD HANDSHAKE" error on connecting to some versions of MySQL server in the MySQL provider is fixed Bug with processing key fields on record posting is fixed Bug with empty string ...

Global site tag (gtag.js) - Google Analytics