moodle and mysql

moodle and mysql

by john s -
Number of replies: 5

Hi,

I am using mysql 4.1.9 on a windows 2003 server running as a service. I also use mysql administrator to back up my DB. I want to upgrade to MYSQL 5 in preparation for 1.6.

 Is it as easy as backing up my data from 4.1.9, installing MYSQL 5 and then restoring the data using MYSQL administrator?

Once I have done this I would proceed with the Moodle upgrade.

Any advice on my strategy would be most welcome.

Thanks in advance

John

Windows 2003 server

Apache 2.58

PHP 4.3

MYSQL 4.1.9

Average of ratings: -
In reply to john s

Re: moodle and mysql

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi John,
your upgrade plan sounds excellent.

  1. To back all the MySQL databases, you can use "mysqldump --all-databases -u root -p > all.sql" from the Windows command prompt. More information is here:
  2. Then upgrade MySQL. The official guidelines are here:
  3. Restore the MySQL tables with "mysql -u root -p < all.sql
  4. Assuming all has gone well, you can now upgrade your Moodle, by simply overwriting the current folder with Moodle 1.6. The Moodle upgrade process will kick in when you login to Moodle as a Moodle administrator.

good luck!
Gordon

In reply to Gordon Bateson

Re: moodle and mysql

by john s -

Hi Gordon,

Thanks for the vote of confidence!! I will proceed.

One other thing that haunts me and I cannot for the life of me work it out. When I log into Moodle and view the database I get a message at the bottom of the screen informing me that I ought to assign a password to the user root as it is a breach of security. So I think, okey dokey - no problem. I launch MYSQL admin and assign a password to root. I then update my config.php file and launch Moodle. To my surprise I get the 'database connection error'. I remove the password and it all works again. How odd I thought! I then created a new MYSQL user, assigned all the rights; assigned a password, updated Config.php and launched Moodle. Again, database error. I change the config.php back to root with no password and it works once again.

I have since copied all data + files to a test server and upgraded MYSQL from 4.1.9 to 5 and get the same problem. I even wrote a simple PHP connect script and this will only connect as root with no password!

I am using PHP 4.3.11 and Apache 2.0.58.

I have little experience with AMP so I am not sure how to trouble-shoot this further.

Any advice you or anybody else could give me will be much appreciated.

Thanks in advance.

John

In reply to john s

Re: moodle and mysql

by sam butler -
you could try to just change the root password via the command prompt....

open up a command prompt window and change directory to your mysql/bin directory. then type mysql, it should ask you for your current root password. when you're "in" type the following
I'd back your data up again before any of this and of course edit config.php with the new password. 

there could also be a problem with passwords stored in an 'old' format, though I think that gives connection errors even for your root user and you're saying that you can get in using your old root password (though there isn't one set, is that right...?). to fix those you would do this from the command promt;

SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpassword');

In reply to sam butler

Re: moodle and mysql

by john s -

Hi Sam,

Thanks for your reply. I tried using the command line to change the password but still the problem persists. The odd thing is that when I do change the password for root, I can log into MYSQL via the command client or MYSQL administrator with the new password. It just fails when I launch Moodle despite amending the config.php file.

Any other ideas will be much appreciated.

John

In reply to john s

Re: moodle and mysql

by sam butler -
it does seem strange, could it be some cache issue (I know that seems ulikely but I can't think of any other reason). my site is cached with an application beyond my contol (at the security layer) and I somtimes have problems with (mainly static) pages not refreshing.