HostMonster Web Hosting Help

MySQLi Troubleshooting

MySQLi is not working.

If the PHP version is PHP 5.2+ or higher, MySQLi will work without any problems.

Common problems with MySQLi are incorrect connection setting such as user_name, datebase_name and password.

The error is as follows for these types:

  Warning: mysqli_real_connect() [function.mysqli-real-connect]:
          Access denied for user 'username_name'@'localhost' (using password: YES/NO) 
          Couldn't connect :
          localhost: Connection error to server 'localhost' with user 'username_user'

The fastest fix is to look at the error and read it. For example, if "(using password: NO)", then you need to make sure your connection is using a password.
If "(using password: YES)", then make sure you are using the correct password.

If the error reports

  Couldn't connect :
          localhost: Connection error to server 'localhost' with user 'username_user'
Make sure you have added the user to the database and granted permissions to this user.

For more information on MySQLi, please visit

Keywords: mysqli
Knowledgebase Article 24,903 views bookmark tags: (updated 1846 days ago)

Was this resource helpful?

Did this resolve your issue?

Please add any other comments or suggestions about this content:

Recommended Help Content

How to enable telnet in Microsoft Windows 7. Telnet is a great tool for troubleshooting email, MySQL and other connection issues. (updated 1761 days ago)
Video "How-to" Tutorial 81,280 views tags: email microsoft troubleshooting windows

Rails Troubleshooting! (updated 741 days ago)
Knowledgebase Article 29,086 views tags: rails

Explains how to create screenshots(screen captures). (updated 775 days ago)
Knowledgebase Article 35,318 views tags: troubleshooting

Related Help Content

Troubleshooting with telnet on different operating systems? (updated 1994 days ago)
Knowledgebase Article 71,002 views tags: command mac macintosh windows

My Google AdWords offer is not working. (updated 1074 days ago)
Knowledgebase Article 63,763 views tags: adwords code coupon google invalid

While trying to deploy my Django application, I am getting error pages. (updated 1748 days ago)
Knowledgebase Article 63,000 views tags: django

General Email issues where should I start? (updated 208 days ago)
Knowledgebase Article 57,917 views tags: blacklisted email

How to install the php.ini file and then increase the PHP Memory limit. (updated 133 days ago)
Video "How-to" Tutorial 159,400 views tags: limit troubleshooting wordpress

This article will explain how to change your WordPress Urls (updated 14 days ago)
Video "How-to" Tutorial 111,159 views tags: login temp troubleshooting urls wordpress

"Publish to the Web" isn't working in MS Publisher. Is there another way? (updated 2221 days ago)
Knowledgebase Article 116,435 views tags: microsoft publisher

FAQMasterFlex doesn't let me login to admin area (updated 2239 days ago)
Knowledgebase Article 51,930 views tags: register