有的 时候我们为了解决某些自己以前弄过的问题 都想着是重装系统 ,其实这是没有办法才这样的!
呵呵!
处理问题的方式告诉我,多在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
分享到:
相关推荐
const connection = mysql.createConnection({ host: 'localhost', user: 'yourusername', password: 'yourpassword', database: 'yourdatabase', }); connection.connect((err) => { if (err) throw err; ...
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 如果...
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 ....
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 ...
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 ...
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 ...
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 ...
System.err.println("Error connecting to the database: " + e.getMessage()); } } } ``` 五、性能优化与监控 1. **配置文件调整**:修改`my.cnf`配置文件,优化参数如`innodb_buffer_pool_size`,以适应...
- 500:Internal Server Error,服务器遇到未知错误。 - 505:HTTP Version Not Supported,服务器不支持请求的HTTP版本。 6. 开源软件及其主要功能: - Spring:企业级应用开发框架,支持AOP、DI等。 - ...
Configuring Apache on Linux/UNIX. . . . . . . . . . . . . . . . . . . . . . 34 Starting and Connecting to Apache. . . . . . . . . . . . . . . . . . . . . . 36 Chapter 3 Installing ...