This site utilizes JavaScript to function correctly. Looks like it's disabled on your browser. Please enable it for your best experience.

For instructions on enabling JavaScript, click here

Skip to main content

Just Host Web Hosting Help

MySQL Error Messages

MySQL Errors

Summary

If you are having connection errors, please make sure you have followed the instructions on our Remote Database Connection Setup article.

Note: The most common problem in connecting is due to an incorrect username and/or password. Please make sure the username you use matches the username created in the "MySQL Database" section of your cPanel.


Examples of MySQL Errors:

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
Couldn't connect to server.

This kind of error clearly shows the issue. Access denied lets you know immediately that the database user or password is incorrect in your PHP file. If you see this error, open the PHP file and make sure the username and password are correct. The database and username must always have the appropriate prefix of username_ (replace username with your actual cPanel username and don't forget the underscore "_"). You can copy the correct spelling from your cPanel, under "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 is a missing punctuation, as PHP code is very sensitive. Unfortunately, our support staff is not trained to deal with coding issues and this may fall beyond our scope of support. Issues dealing with scripting, coding, or third party products may be best consulted with a professional programer, design group, or developer of the third party product.

Knowledgebase Article 131,062 views bookmark tags: errors mysql


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

I get the following database connection error: Warning: mysql_connect() [function.mysql-connect]: Host 'host#.Justhost.com' is blocked because of many connection errors; unblock with 'mysqlad
Knowledgebase Article 265,005 views tags: blocked connection host localhost mysql

This article will explain some common causes for 500 errors on Dedicated or V.P.S servers.
Knowledgebase Article 129,218 views tags: dedi dedicated error server vps

Look for the error message that most closely matches the one you received.
Knowledgebase Article 196,765 views tags: email error

Related Help Content

How do I avoid Outlook IMAP timeout errors?
Knowledgebase Article 309,087 views tags: errors imap outlook timeout

Why do my email messages keep getting returned?
Knowledgebase Article 402,801 views tags: email messages returned sending

Optimizing MySQL: Queries and Indexes Article 4 of 4 Courtesy of:Ian Gilfillan Most systems need to be highly optimized for selects - take a news site which performs millions of queries per day, but w
Knowledgebase Article 214,173 views tags: cpu exceeded index indexes mysql optimize optimizing queries query

This article will explain how to change or reset the password for a MySQL user.
Knowledgebase Article 154,591 views tags: change mysql password reset user

Optimizing MySQL: Queries and Indexes Article 2 of 4 Courtesy of: Ian Gilfillan Some knowledge of how indexes work allows you to use them more efficiently. Firstly, note that when you update a table w
Knowledgebase Article 187,089 views tags: indexes mysql optimize optimizing queries query

Optimizing MySQL: Queries and Indexes Article 1 of 4 Courtesy of: Ian Gilfillan Badly defined or non-existent indexes are one of the primary reasons for poor performance, understanding and then fixing
Knowledgebase Article 220,105 views tags: indexes mysql optimize optimizing queries query

Optimizing MySQL: Queries and Indexes Article 3 of 4 Courtesy of: Ian Gilfillan Ordering by surname is a common requirement, so it would make sense to create an index on surname. But in this example o
Knowledgebase Article 220,317 views tags: cpu exceeded index indexes mysql optimize optimizing queries query

This article will explain MySQL database and user creation and deletion, and explain how to assign a user to a database.
Knowledgebase Article 873,127 views tags: creation database mysql

** Google ad credits are only available to customers in the United States, Canada, and the United Kingdom at this time.

¹ VAT (Value Added Tax) is not included in our advertised price and will be charged separately and itemized on invoices and billing information. Standard VAT rates based on EU Member State regulations may apply. Learn more.