Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm setting the mysqladmin passwords like so :

mysqladmin -u root password my_password

And this returns :

mysqladmin: connect to server at '' failed
error: 'Unknown MySQL server host '' (1)'
Check that mysqld is running on and that the port is 3306.
You can check this by doing 'telnet 3306'

How do I check that mysqld is running, and better yet, how do I fire her up?


Thus so far:

I logged into the remote DB server ( an EC2 instance ), and performed this :

vi /etc/mysql/my.cnf

The option skip-networking was already commented out as well as the bind-address. So I uncommented the bind address, and added the IP of my remote server, and restarted mysqld.

That didn't work. So I tried the remote DB server. That didn't work.

On the remote DB server ( EC2 Instance ), the only command for mysqld you can perform is mysqld with no options. I'm just assuming this is actually appropriately resetting it when I write this because it hangs on the command for a few minutes before proceeding.

Running this netstat -nl | grep :3306 on the remote DB server returns this :

tcp        0      0  *               LISTEN

Not sure if this is relevent, but /etc/init.d/mysqld does not exist on the remote DB server. But the command does exist in /usr/sbin/mysqld .

share|improve this question
Assuming that what you posted is the real name of the host you're trying to connect to, it doesn't resolve in DNS to any IP address. I don't know whether MySQL is running or not on the host, but you are not going to be able to connect to it by using this host name. Can you try connecting by IP address? – Massimo Nov 2 '11 at 15:15
I changed a couple numbers. Were you testing it? It seems to be running on the host because I can log into it directly with a mysql command and no password. – Trip Nov 2 '11 at 15:17
up vote 1 down vote accepted

It has already said:

$ telnet 3306

If you cannot connect, make sure that the hostname can resolve to the right IP address:

$ nslookup

If it does, ssh to your server and start it if it hasn't been started:

$ ps -ef | grep mysql
$ sudo /etc/init.d/mysqld start


tcp 0 0* LISTEN

It means that your MySQL server only listening to the localhost, disable the remote access. If you really want to allow, do the below steps:

  • ssh to your server
  • open the /etc/my.cnf file and change the bind-address to your public IP
  • comment out the skip-networking option (put a # at the begin)
  • restart mysqld: /etc/init.d/mysqld restart
  • grant access to the user: grant all privileges on foo.* to 'user'@'IP' identified by 'password';
share|improve this answer
Ah great idea. Still getting used to a few new things here. But I was able to SSH into the remote server ( no password was required ). Then the only option I can run is mysqld. Then I did a ps aux | grep mysqld, looks like its running. Still the same error though when trying to set the passwords. – Trip Nov 2 '11 at 15:26
ssh to your server and post the output of netstat -nl | grep :3306? – quanta Nov 2 '11 at 15:33
tcp 0 0* LISTEN – Trip Nov 2 '11 at 15:35
I also tried to just connect to the IP instead of the host and I get a timeout. – Trip Nov 2 '11 at 15:35
This is what it says on the remote db server as well tcp 0 0* LISTEN – Trip Nov 2 '11 at 15:41

Your Answer


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.