MySQL Root Password

MySQL Root Password

Klauss Migliano發表於
Number of replies: 6
Hi everyone,

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.
評比平均分數: -
In reply to Klauss Migliano

Re: MySQL Root Password

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
I would strongly advise against using the root password for Moodle (or trying to, anyway).

Did you read... http://docs.moodle.org/en/Create_Moodle_site_database#MySQL_client
In reply to Howard Miller

Re: MySQL Root Password

J C發表於

Wow, this last reply was a complete waste of time. It didn't refer to how he should set dbuser in config.php at all!

I am having the same problem and searching and find these wasteful replies but no answers.

In reply to J C

Re: MySQL Root Password

Marcus Green發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片

The database username/password is only stored in config.php What error does it show?. Don't use the root password to the MySQL server for moodle.

In reply to Marcus Green

Re: MySQL Root Password

J C發表於

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

In reply to J C

Re: MySQL Root Password

G. M.發表於

The password at config.php must be plain text.

Cheers!

In reply to G. M.

Re: MySQL Root Password

Marcus Green發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片

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.