The Movable Type Knowledge Base

Connection errors (MySQL)

Question

When running the script, I get an error message that says Got an error: Bad ObjectDriver config: Connection error: [some error].

Answer

Too many connections

Your MySQL server is not permitting any more connections to your database; you'll need to contact your host for resolution of this error.

Can't connect to local MySQL server through socket '/path/to/socket'

  • If your SQL database server is on localhost, but the socket is not in a standard location, you'll need to set the path using the DBSocket directive in mt-config.cgi1:
    DBSocket /path/to/mysql.sock
  • If your SQL database server is not local, you should be using the DBHost directive in mt-config.cgi to specify the location of the server:
    DBHost database_host
    replacing database_host with the proper hostname.

Access denied for user: 'username@hostname' (Using password: YES)

  • Make sure that you set your password in mt-config.cgi2:
    DBPassword database_password

    You should replace database_password with your actual password, and also make sure that you have uncommented the directive3.

  • Make sure you uploaded mt-config.cgi to your server in ASCII mode and to the same folder where mt.cgi is located.

  • Make sure that you associated username with the database you have created with the same password you designated in mt-config.cgi.

  • Make sure that you granted username full privileges to the database.

Access denied for user: 'username@hostname' (Using password: NO)

This means the connection attempt is being made without a password. Make sure that you set your password in mt-config.cgi2:

DBPassword database_password

You should replace database_password with your actual password, and also make sure that you have uncommented the directive3.

Access denied for user: '@hostname'

The database username is missing from the error message, which indicates some directives may not have been specified correctly in mt-config.cgi1. Before editing, the relevant lines in mt-config.cgi look like this:

# ObjectDriver DBI::mysql
# Database <database-name>
# DBUser <database-username>
# DBHost localhost

Note that the <database-name> and <database-username> sections should be replaced with the correct information; in other words, you should not leave the < and > symbols in place when substituting your database and user names. You must also uncomment each of these directives3.

Client does not support authentication protocol requested by server; consider upgrading MySQL client

A change was made in MySQL 4.1 and higher to the password authentication process, and this change is not backward-compatible. Every MySQL client has to be updated in order to work with this new version of MySQL.

The DBD::mysql module is the "MySQL client" in this case, and it has not yet been updated for this change, so you will need to either 1) reset the password to pre-4.1 style for your database user, or 2) tell the server to use the older password hashing algorithm. Instructions for both of these options are included in the MySQL documentation for this error message.

1 In versions prior to 3.2, the configuration file is named mt.cfg.

2 In versions prior to 3.2, the password is set separately in mt-db-pass.cgi.

3 To uncomment a directive means to remove the # from the beginning of the line where it appears.

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or questions. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Yahoo! Small Business web hosting services

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.