Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a dedicated server (CentOS 5.3) but I can't log on to mysql as admin from outside, however I can do that when I'm on server's command line. I assume there's a setting somewhere that can give me the access I need, but I don't know where.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

There are several factors and your question doesn't include enough information to know which of these you are up against.

First make sure your server is listening on your network port. Listening on just 127.0.0.1 will not cut it since that only allows loop-back connections to the localhost. You need to listen on 0.0.0.0

bind-address=0.0.0.0

Next make sure you are using TCP networking at all. Mysql can use just local sockets, so make sure this line is commented out in your config:

#skip-networking

That done you should have a mysqld daemon listening. You can test like this:

# netstat -lntp | grep mysqld
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      2652/mysqld

(Note that my sample output is only listening on localhost! Yours should read with your interface IP or 0.0.0.0 if this is going ot work.)

Lastly you need to have the right privileges setup in mysql itself. Each user has a host that it is allowed to connect from. If you ran your GRANT statements and only gave permissions ON 'localhost' or something like that, you still won't be able to login remotely. You need to include the specific host you want to allow or '%' for any host.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.