Joomla Server Move caused Unable to connect to MySQL database

Posted on 2011-04-28
Last Modified: 2012-05-11
I had a working Joomla website hosted by a web-hosting company. I agreed to let them upgrade the site from legacy servers to their grid.

Since the move I have gotten this when I try to access the site: Database Error: Unable to connect to the database:Could not connect to MySQL

I believe the site is on Joomla 1.5.7

The hosting support guy said there was some problem with the database password when migrating to the grid and had me change to a new password.  

I changed it to a new password with their control panel and was able to view the database using phpMyAdmin.

I updated the password in the configuration.php file to match but it didn't help. I double-checked that the $host still matched the hosting company's control panel information and the user had not changed either.

This morning I thought maybe there was some other file with the password I was missing so I tried changing back to the original password in the control panel. It let me change it in the control panel but phpMyAdmin did not change and I couldn't log in.

So at this point I went back to the "new" password and have the configuration.php file using it and can get in to phpMyAdmin with it. I'm still getting the unable to connect to MySQL message though from the site.

Is there anything else I can check? Is there some way to make sure the grid can see my database server? Could there be some incompatibility between my Joomla 1.5 and the version of something else (the hosting company is only offering 1.6 for download now)?

Thanks for your help and ideas.
Question by:EndeavorToPersevere
    LVL 6

    Accepted Solution

    Uhh very hard to say what could be the problem.... I think that the configuration.php file is the only file with the possibility to change database access in Joomla; usually the $host = localhost; did you check the rights of the database user you use for Joomla in phpmyadmin? Also i would try a fresh Joomla 1.5 installation to check if the same happens....

    LVL 2

    Author Comment

    Thanks for your suggestions. I am looking into them.

    One question I had was what privilege the user_privilege table should have? Mine had USAGE. The Schema_privilege table had all the privileges.
    LVL 2

    Author Closing Comment

    That wasn't the whole problem but you got me looking in the right direction.  It turns out the server they moved my website to didn't have access to the database server.

    I had to create a new database, export from the old database and import into the new database. Then I updated the configuration.php file with the new server, database, user and password.

    Thanks for your suggestions. They did help a lot!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    I have been using r1soft Continuous Data Protection ( for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    This video discusses moving either the default database or any database to a new volume.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now