colly72 Posted July 14, 2014 Posted July 14, 2014 I've upgraded MySQL from 5.1 to 5.5, in preparation for upgrading to the latest version of Moodle. After backing up the Moodle DB using PHPmyadmin, uninstalling MySQL 5.1 and installing 5.5, I've then restored the moodle DB using PHPmyadmin and added a user, granting all privileges to the database. I've then run mysql_upgrade on the db. When I try to browse to Moodle I get the following errror: Error: Database connection failed It is possible that the database is overloaded or otherwise not running properly. The site administrator should also check that the database details have been correctly specified in config.php I've checked the details in config.php and they've not changed, so I'm at a loss what to do. I'm on Windows 2008 R2. Can anyone let me have some advice? Thanks, Michael
colly72 Posted July 14, 2014 Author Posted July 14, 2014 Yes, the service is running. I can access the db fine from PHPmyadmin
unixman_again Posted July 14, 2014 Posted July 14, 2014 Can you connect to the database using the cmd prompt? Something like c:\Program Files\MySQL\MySQL Server 5.5\bin\mysql.exe -D moodle -u moodleuser -p Also connect as root, and look at the users & db tables, making sure all of the grants are correct.
colly72 Posted July 14, 2014 Author Posted July 14, 2014 Thanks for the suggestion - I can connect both as root and moodleuser, via command prompt. I've checked the privileges on the db and granted full moodleuser
penfold_99 Posted July 14, 2014 Posted July 14, 2014 In your config file are you using mysql or mysqli? It needs to be the latter.
colly72 Posted July 14, 2014 Author Posted July 14, 2014 Yes, I've restarted it a few times. It's really baffling me.
unixman_again Posted July 14, 2014 Posted July 14, 2014 Here's a really off the wall suggestion, but it has helped me in the past. Install Apache and use that rather than IIS. You might see something of use in the error log. I had to do this when IIS was reporting a 500 error but not logging any more than that.
OverWorked Posted August 7, 2014 Posted August 7, 2014 I've just had the same issue. I'm not at all familiar with MySQL so had me stuck for a while. My solution was to use the MySQL workbench to import the moodle schema from the backup sql file (had to create a moodle schema to restore to). Recreate the moodleuser account and just gave it full DBA privileges (I don't know what it's supposed to have, but I'll correct that later). It looks like you may have tried all this, so sorry if this doesn't help.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now