Common MySQL Errors
Posted by ASO Admin on 11 February 2020 07:40 AM
If you are having SQL connection errors, please make sure you have followed the instructions in our Connect to Your Database Remotely article.
Note: by FAR the most common problem in connecting to your database is because you are using an incorrect username and/or password. Make sure the username you use matches the username created in the MySQL Database section of your cPanel.
MySQL Error Examples
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'Username'@'localhost' (using password: YES) in/home1/examplec/public_html/config.php on line 3
This kind of error clearly shows the issue. "Access denied' lets you know immediately that the database name or password is incorrect in your PHP file. The database and username must always have the appropriate prefix of 'username_', just replace 'username' with your actual cPanel username and don't forget the underscore. You can copy the correct spelling from your cPanel dashboard from the MySQL Databases section.
Parse error: syntax error, unexpected T_STRING in/home1/examplec/public_html/index.php on line 31
This kind of error means you have made a mistake in your coding. Generally, it indicates missing punctuation, as PHP code is very sensitive. Unfortunately, our Support staff isn't trained to deal with the gamut of code issues like this that our customers face, and this may fall beyond our scope of support. Issues dealing with scripting, coding or third-party product help may be best remedied by consulting with a professional programmer, developer or designer.