`
jsjxqjy
  • 浏览: 116927 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

error linux connection to mysql server on 10065

阅读更多

有的 时候我们为了解决某些自己以前弄过的问题 都想着是重装系统 ,其实这是没有办法才这样的!

 

 

   呵呵!

 

  处理问题的方式告诉我,多在javaeye上 转下 ,问题就好解决了

 

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

 

 后来在网上查了,

1.

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

 

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

 

 授权法。例如,你想 qjy  

使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO 'qjy'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
要及时生效 : FLUSH PRIVILEGES
如果你想允许用户kevin从ip为192.168.1.101的主机连接到mysql服务器,并使用mypassword作为密码

GRANT ALL PRIVILEGES ON *.* TO 'qjy'@'192.168.1.101' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

 3. 防火墙

 

//关闭防火墙 

service iptables stop 

 

 

小结 :

 

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

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

 +------+------+
| Host | User |
+------+------+
| %    | root |
+------+------+

 

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

 

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

 

 以上是个人小结。

大家有兴趣可以看  http://taink.iteye.com/blog/493639

 

http://taink.iteye.com/blog/493633  2篇文章  作者 taink

 

分享到:
评论

相关推荐

    node-tcp-server:Node.js 中的一个简单 TCP 服务器,用于将接收到的数据写入 MySQL 数据库

    const connection = mysql.createConnection({ host: 'localhost', user: 'yourusername', password: 'yourpassword', database: 'yourdatabase', }); connection.connect((err) => { if (err) throw err; ...

    Linux mariadb安装配置启停手册.docx

    cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld chkconfig --add mysqld chkconfig --list mysqld 四、启动Mariadb服务 service mysqld start Starting mysqld (via systemctl): OK 如果...

    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 ....

    UniDAC 7.1.4

    Bug with recreating a connection on Linux and mobile platforms is fixed PostgreSQL data provider SSPI authentication is supported Processing GUID data type for the TGuidField class is improved ...

    unidac_7_1_4_pro DELPHI 10 Tokyo

    Bug with recreating a connection on Linux and mobile platforms is fixed PostgreSQL data provider SSPI authentication is supported Processing GUID data type for the TGuidField class is improved SQLite ...

    Unidac Pro 7.1.4 XE8

    Bug with recreating a connection on Linux and mobile platforms is fixed PostgreSQL data provider SSPI authentication is supported Processing GUID data type for the TGuidField class is improved SQLite ...

    unidac_7_1_4_pro DELPHI 10 Berlin

    Bug with recreating a connection on Linux and mobile platforms is fixed PostgreSQL data provider SSPI authentication is supported Processing GUID data type for the TGuidField class is improved SQLite ...

    MariaDB 服务器部署说明

    System.err.println("Error connecting to the database: " + e.getMessage()); } } } ``` 五、性能优化与监控 1. **配置文件调整**:修改`my.cnf`配置文件,优化参数如`innodb_buffer_pool_size`,以适应...

    某外企java笔试题

    - 500:Internal Server Error,服务器遇到未知错误。 - 505:HTTP Version Not Supported,服务器不支持请求的HTTP版本。 6. 开源软件及其主要功能: - Spring:企业级应用开发框架,支持AOP、DI等。 - ...

    php_6_fast_and_easy_web_development.pdf

    Configuring Apache on Linux/UNIX. . . . . . . . . . . . . . . . . . . . . . 34 Starting and Connecting to Apache. . . . . . . . . . . . . . . . . . . . . . 36 Chapter 3 Installing ...

Global site tag (gtag.js) - Google Analytics