Skip to content

MySQL Connection Problems

DiddiZ edited this page Jul 11, 2011 · 7 revisions

There could not be established a connection to the MySQL server. This can have many reasons.

  • Your MySQL server could be down. Start it with /etc/init.d/mysqld restart on Linux or net start mysql on Windows.

Local MySQL Server

  • Try to use 127.0.0.1 or the domain instead of localhost.

Remote MySQL server

  • Check whether you spelled the ip right. Don’t use your your ip, when it’s not static, better use the domain.

  • Check whether the server where your MySQl server is hosted is accessible at all: ping <ip>

  • The MySQL server has to accept remote connections. Many hosted MySQL servers refuse that. Ask your hoster if they could enable it for you. When you’ve root access to your MySQL server, you good luck, you can set it yourself. Open the MySQL config, it’s normally located at /etc/mysql/my.cnf on Linux or C:\Programme\MySQL\MySQL Server 5.5\my.ini in Windows, and make sure that skip-networking is deleted or outcommented and set bind-address to the ip (or better domain) of your Minecraft server.

Access denied for user '<user>'@'<host>' (using password: NO)

  • Make sure you put the password in singlequotes, like 'pw'. If your MySQL user doesn’t have a password (really not recommended!) use an empty string: ''.

  • If it keeps telling password: NO but you’ve entered one, you are trying to use a username that doesn’t exist.

Access denied for user '<user>'@'<host>' (using password: YES)

  • Check if you spelled the password right. (single quotes again!)

  • The user might not have sufficient rights on the database. Grant all privileges to the user with this query: GRANT ALL PRIVILEGES ON <database> TO '<user'@'localhost'; The quotes around user and host are necessary. If you’ve a remote server, use '%' instead of 'localhost'

Clone this wiki locally