Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm setting the mysqladmin passwords like so :

mysqladmin -u root -hec2-50-17-36-83.compute-3.amazonaws.com password my_password

And this returns :

mysqladmin: connect to server at 'ec2-50-17-36-83.compute-3.amazonaws.com' failed
error: 'Unknown MySQL server host 'ec2-50-17-36-83.compute-3.amazonaws.com' (1)'
Check that mysqld is running on ec2-50-17-36-83.compute-3.amazonaws.com and that the port is 3306.
You can check this by doing 'telnet ec2-50-17-36-83.compute-3.amazonaws.com 3306'

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

Thanks!

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 0.0.0.0:3306            0.0.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

1 Answer 1

up vote 1 down vote accepted

It has already said:

$ telnet ec2-50-17-36-83.compute-3.amazonaws.com 3306

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

$ nslookup ec2-50-17-36-83.compute-3.amazonaws.com

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

UPDATE

tcp 0 0 127.0.0.1:3306 0.0.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 127.0.0.1:3306 0.0.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 0.0.0.0:3306 0.0.0.0:* LISTEN –  Trip Nov 2 '11 at 15:41

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.