mysql remote access failed
Hi,
I'm using slackware 13.1 and I have a problem to accept remote access to mysql server. The steps I have followed to do that thing are:
Although I can connect locally, i.e. mysql -u a_user -h localhost -p I can't do it remotely i.e. mysql -u same_user -h my_ipaddress -p I have also turned off my firewall, but nothing. telent 3306 my_ipaddress results in: telnet: connect to address my_ipaddress: Connection refused My my.cnf file is: Code:
[client] |
"Connection refused" usually means that nothing is listening on that address and port.
What does "lsof -i tcp:3306" return? |
Quote:
|
Access with "mysql -u a_user -h localhost -p" likely goes through the Unix socket rather than over TCP.
Dumb question but have you restarted mysql since modifying my.cnf? |
Check /etc/rc.d/rc.mysqld and comment out the line:
Quote:
|
Ok...I think I found something.
Till now I was starting, restarting the mysql server through /etc/rc.d/rc.mysqld restart. I remembered that while it was starting mysql logged all the messages to a file /var/lib/mysql/my_domain.err And as you can imagine I found errors. I stopped the mysql server and I restarted it through mysqld_safe which is better. And I found the following in my_domain.err file: Code:
101228 23:06:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql Code:
101228 23:02:38 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql |
Quote:
Nop...Nothing the same errors as the ones I mentioned exactly before. Now I can't even start the mysql server with /etc/rc.d/rc.mysqld start I don't know if it will help but I have MySQL version 5.1.46. |
What gives
Code:
ps -ef|grep mysql |
Ok...I found the solution.
I had to write: bind-address = 0.0.0.0 It has to be a feature of mysql 5.1x. Thanks for your help, I wouldn't have managed it without you. However 0.0.0.0 means that it binds with any address...I hope there isn't any security issue with that |
Nope it an option used also in previous mysql versions. Note that bind-address is used if you want to specify just one interface you want mysqld to listen on. Assigning the 0.0.0.0 address in bind-address is the same as commenting out skip-networking.
Quote:
Also make sure you specify who and from where can connect to your server (like user@localhost) and always use strong passwords for these users. Regards |
Quote:
So I suppose that mysql 5.1x accepts only 0.0.0.0. However, it seems strange, since I could configure it like that in mysql 5.0x |
Hi again,
I just find out another issue. Every time I restart my computer the remote access stops working. Although I'm able to connect locally, i.e. through the command Code:
mysql -u {mysql-user} -h localhost -p Code:
telnet localhost 3306 Code:
telnet my_ipaddress 3306 Code:
Trying 127.0.0.1... Code:
lsof -i tcp:3306 In order to correct that I do the following: Code:
/etc/rc.d/rc.mysqld stop; mysqld_safe & |
Hi,
You should have a look again at my post #8 above. Regards |
I suppose you mean the following post
Quote:
|
Just undo the changes you made in mysqld_safe and/or my.cnf
Then edit /etc/rc.d/rc.mysqld, comment out the line "SKIP=--skip-networking" and try to start/stop the server from the init script |
All times are GMT -5. The time now is 10:25 AM. |