MySQL connection problem need help!

July 29, 2014 912 views

Created a database, trying to use it in a script with an installer built in, located at on and using the following values;

Hostname - localhost
Database - passworx
Username & password entered precisely

The installer keeps kicking me out of the Databse conenction step, so I'm just checking to see if I am doing anything wrong here. Like, should I be using something else beside localhost for example?

2 Answers

Try connecting to MySQL from the CLI:

mysql -h localhost -u passworx -p

It should prompt you for a password. If the credentials are correct, you will see a mysql shell prompt:


You should be able to use localhost even if mysqld is listening on your public IP address.

Try to connect to your server via SSH and execute the following command:

mysql -u username -p

Enter the password when prompted and see if it allows the connection. If you get an error such as access denied, then you probably forgot to flush the privileges.

In case the connection fails then mysqld is probably not running. You can check that by executing the following command:

ps x -A | grep mysqld

Have another answer? Share your knowledge.