Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-10-2011, 11:09 AM
|
#1
|
LQ Newbie
Registered: Jun 2011
Posts: 24
Rep:
|
Mysql accept remote connections
Hello, i want mysql to accept remote connections so i found this guide http://www.cyberciti.biz/tips/how-do...se-server.html and i followed it.
Step # 5 Grant access to remote IP address
i want "How Do I Grant Access To An Existing Database?"
mysql> update db set Host='202.54.10.20' where Db='webdb';
mysql> update user set Host='202.54.10.20' where user='webadmin';
doesn't helped me so i added the user from the phpmyadmin page.
Finally , my mysql does not accept remote connections. Do you have another guide ? or an idea whats going wrong ?
|
|
|
10-10-2011, 12:34 PM
|
#2
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,215
|
Hi,
Make sure you don't use a "skip-networking" either in my.cnf, or in the mysqld service startup script.
You can run
Code:
netstat -tanpl|grep mysql
to see if mysqld is listening and on what IP(s)
Regards
|
|
|
10-10-2011, 01:21 PM
|
#3
|
LQ Newbie
Registered: Jun 2011
Posts: 24
Original Poster
Rep:
|
thanks for the command.
root@b0x:~# netstat -tanpl|grep mysql
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 28329/mysqld
root@b0x:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- x.x.x.x anywhere tcp dpt:mysql
x.x.x.x = the ip of the client i want to connect
[mysqld]
#
# * Basic Settings
#
...
bind-address = my server real ip here
#skip-external-locking
|
|
|
10-10-2011, 02:23 PM
|
#4
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,215
|
Quote:
root@b0x:~# netstat -tanpl|grep mysql
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 28329/mysqld
|
mysqld is listening only on the local loopback interface, that's why you cannot connect from other boxes. Are you sure you use your server public IP in the "bind-address" option?
Try to comment out the "bind-address", as by default mysqld will listen on all available interfaces, and restart the service.
|
|
|
10-10-2011, 02:55 PM
|
#5
|
LQ Newbie
Registered: Jun 2011
Posts: 24
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
mysqld is listening only on the local loopback interface, that's why you cannot connect from other boxes. Are you sure you use your server public IP in the "bind-address" option?
Try to comment out the "bind-address", as by default mysqld will listen on all available interfaces, and restart the service.
|
i already have it as you say , look at my latest post , the line does not have # in front of it
thanks for helping
|
|
|
10-10-2011, 03:14 PM
|
#6
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,215
|
Quote:
i already have it as you say , look at my latest post , the line does not have # in front of it
|
Yeah I saw that, but since it's not working (as mysqld listens on 127.0.0.1), I told you to comment it out (add the # in front) and restart mysqld.
Could be that you're using the wrong my.cnf. Usually it's located in /etc/my.cnf
|
|
|
10-10-2011, 03:30 PM
|
#7
|
LQ Newbie
Registered: Jun 2011
Posts: 24
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
Yeah I saw that, but since it's not working (as mysqld listens on 127.0.0.1), I told you to comment it out (add the # in front) and restart mysqld.
Could be that you're using the wrong my.cnf. Usually it's located in /etc/my.cnf
|
its the only my.cnf
|
|
|
10-10-2011, 05:23 PM
|
#8
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,215
|
Could be the only my.cnf, but mysqld looks like it doesn't use it. Did you try to comment out the "bind-address ...' line and see what happens?
You could also edit the /etc/init.d/mysqld (or whatever is called the startup script for your distro) and add either a "--no-defaults" or a "--defaults-file=/etc/my.cnf" among the other startup options
|
|
|
10-10-2011, 09:36 PM
|
#9
|
LQ Newbie
Registered: Jul 2007
Posts: 16
Rep:
|
Hello,
Please check your servers /etc/hosts file.
< IP > localhost.localdomain localhost
If the above entry present the comment it our and make it like this:
< IP > <Servers FQDN>
Thanks & Regards,
Ramesh Shihora
|
|
|
10-11-2011, 05:43 AM
|
#10
|
LQ Newbie
Registered: Jun 2011
Posts: 24
Original Poster
Rep:
|
thanks for helping my problem solved , my.cnf had 2 bind-address lines (the other one was far too down)
|
|
|
All times are GMT -5. The time now is 05:37 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|