Situation is as follows, a moodle server was originally setup using the MoodleWindowsInstaller on a Win2k Server, as a test platform, Start Moodle.exe used to run Apache and mysql and all of the defaults used for the install.php script.
The server has been a success and we are now looking to make it a live production server, however the root mysql password was left as blank so I would like to change this before the server goes live, but haven't been able to successfully do this.
I Reset the Root password from command line using command
mysqladmin.exe -u root Password newpassword
this worked and mysql administrator GUI now logs in with the new password
as soon as i do this Moodle falls over with a error as you would expect, so i modified the config.php to include the new root password
c:\moodle\server\moodle\config.php
$CFG->dbpass = 'newpassword';
but moodle still displays error, where am I going wrong? is the password stored in another config file? I have tried to flush-privileges on mysql, stopped and restarted Apache and mysql
I have granted permissions for root on moodle database
and to confuse me even more before I change the root password if I modified config.php first and change the dbpass to anything moodle doesn't fall over as if its not using config.php
Im trying to install this moodle on my server http://www.carti.com.br to do some teaching on SEO lesons.
Did you read... http://docs.moodle.org/en/Create_Moodle_site_database#MySQL_client
Marcus, Thank you for your reply.
I think the OP will be answered by the same question, if I state it more clearly.
1. After changing the username and pwd for MySQL access via cPanel or phpMyAdmin, or wherever
2. How do I rehash the 'new' password to include it in config.php?
I can do it in the clear (unhashed), but that is not desirable.
Thanks!
- John
I can confirm the comment by Guillermo that config.php must be in plain text. This is a standard approach to web applications. In over ten years of playing with many, many PHP web applications I have never seen one that does not use a plain text configuration file.
To flesh out the MySQL root password issue, the idea is that root can do anything to any database within the MySQL instance (including system tables). By contrast the access to your moodle database should usually only have access to the Moodle related tables.