Our Dean of Faculty is the Moodle guy. He has lost his account access, and his account was the single moodle administrator account. Interestingly, every other account is still able to login, but his is broken. All the teachers and students can log in.
So, obviously we need to re-enable that account, or create a new admin account. I'm assuming it can't be done through the web interface.
Is there a way for me to create a new moodle admin account from the Linux shell command line?
Thanks in advance for the help.
Stan Hoeppner
Systems Admin
Whitfield School
St. Louis, MO
if you have access to phpmyadmin or mysql for the moodle instance the easiest way is to screw with the database "user" table. find an account where someone does know their password and:
SELECT password FROM user WHERE username = ';'
save the result set, it should be a 40(?) digit hash. then:
UPDATE user SET password = '' WHERE username = 'admin'
the admin's password will now be same as the volunteered account's and the admin can log in with that password and change it!
remember: there is always a mysql login/password in the moodle/config.php, and you should be able to do all of this inside of 'mysql' from the linux shell.
this is of course assuming that it is simply an issue of a missing password. if not, let me know, i will attempt an account retrieval howto
cheers!
Also, somehow the root account can no longer access the database(s). I've seen errors in /var/log/messages pertainting to some cron'd database maintenance failing because the root user password is incorrect
Some background on my moodle installation:
Instead of building a server from scratch, I used the VMware virtual appliance downloaded from the VMware website:
http://www.vmware.com/vmtn/appliances/directory/287
It was created by Farren Constable. (Farren can you please help??!!?)
The system is SuSE 10.1. After the initial installation I changed the root password, for obvious reasons. It appears that the root password change broke the root account from being able to access the databases. Also, the sql admin account "admin" cannot access the databases either. Or is this not the actual name of the sql admin account.
I've got so many problems going on (it seems like multiple problems anyway) that I don't know where to begin.
I've read a bunch of administration posts about fixing the moodle admin user password. I read a post about changing the sql admin password, but it didn't give the EXACT command line syntax. I am a complete mysql nubie. I don't, AFAIK, have any of the sql admin GUI tools. I can acces "mysqladmin" from the command line, but at present I can't do a thing because it seems all the passwords are incorrect.
Someone please help!! I need to have this all fixed up by tomorrow.
Help!
I would get a copy of MySQL Admin from the MySQL site and try to get a connection to your database with that first
got your message just now, please disregard the reply.
you might try simply "mysql -u root" to see if a root password is even set. otherwise, it looks like you are in a bit of pickle. i like the idea of running through all the old passwords, and also you might try checking the moodle config.php for a password to your database.
when you bring up moodle in a browser window do you have an db errors?
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
AFAIK, I've tried all the old passwords, to no avail.
Where the heck is moodle config.php? I can't seem to find it.
Bringing up moodle in a browser gives no DB errors, and low and behold, I can log in again with a regular moodle user account. I dont get it. I haven't changed anything since yesterday, but yesterday no regular moodle users could log in. Currently, course content shows up, and the site seems to be running 'normally'. All of the links I've tested work.
Also, something I forgot to mention earlier. I've noticed that the directory /var/log/apache2/ on occasion gets set as a 'read only' filesystem, which is inexplicable. Don't know if this helps any.
Also, here are some errors I'm getting in /var/log/messages:
Sep 17 16:00:02 moodle logrotate: /usr/bin/mysqladmin: connect to server at 'localhost' failed
Sep 17 16:00:02 moodle logrotate: error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Sep 17 16:00:02 moodle logrotate: /etc/logrotate.d/mysql failed, probably because
Sep 17 16:00:02 moodle logrotate: the root acount is protected by password.
Sep 17 16:00:02 moodle logrotate: See comments in /etc/logrotate/mysql on how to fix this
Sep 17 16:00:02 moodle logrotate: error: error running postrotate script for /var/lib/mysql/mysqld.log
I looked for /etc/logrotate/mysql for help, but the logrotate directory doesn't even exist...
mysql -u=admin
with no password.
So, now maybe I can finally try using some of the hints above to reset the administrator password.
So, I guess I need to create a new moodle admin account. Any ideas? I'll search the forums for it. It's probably come up before.
I'd still like to be able to fix the logrotate and some other things that are broken, also apparently due to rights.
I was able to turn an account into an admin and regain "control" of our moodle server.
I haven't been able to get a primary admin set, but that's not a big deal now that I can assign administrators from the mysql command line.
Stan
Ihave an issue with this code Could not create guest user record !!!. I have read about the sql and phpmyadmin, but I cant figure out how to use any of it. I am new to MOODLE managing. Can anyone help me out in laymans terms?