[Webinar] Learn how to a build a cloud-first strategyRegister Now


Joomla Server Move caused Unable to connect to MySQL database

Posted on 2011-04-28
Medium Priority
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
  • 2

Accepted Solution

Jelcin earned 750 total points
ID: 35487947
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....


Author Comment

ID: 35488659
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.

Author Closing Comment

ID: 35498459
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!

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

865 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