drlippman / IMathAS

IMathAS Online Math Assessment
Other
113 stars 99 forks source link

Reset mysql password #305

Closed cchuang2009 closed 2 years ago

cchuang2009 commented 2 years ago

Initially Imathas was setup by user without passwords. After running awhile, and reset the user with a new passwords for security and modify the setting in "config.php", but can't login again. And check the mysql error log, it shows the error:

Access denied for user 'root'@'localhost' (using password: NO)

Where do I need to modify for the mysql connection corrected?

drlippman commented 2 years ago

To change the mysql password, you'll need to change it directly in the database, using some database admin tool. Once it's set, make sure to update your config.php and store it as $dbpassword.

Note that the database password is totally different than the password you use to login to the system itself as an admin user.

cchuang2009 commented 2 years ago

In my last posted, I changed the MySQL user's passwords, actually "root" itself, directly in mysql database, and change updated config.php; the problem is still there.

However, re-install the IMathAS (in different folder) from github source with another MySQL database and user with passwords as same as ones in previous IMathAS installed; it works (for the new installed IMathAS system). Since the different IMathAS has the same root setting for IMathAS but using different databases, I try to copy the new "config.php" into the previous IMathAS, with database updated for the old one and login again; it is still failed. Anything I forgot here? Thanks.

enoxos commented 2 years ago

Access the MySQL databse directly from the command line (CLI) and type: mysql -u root -p It will prompt you for a password, can you at least get to this password prompt? What happens if you just hit enter (empty password)?

cchuang2009 commented 2 years ago

I think I found the problem. I don't know when and why I use the "admin/passwords" as admin of the previous IMathAS system, but not "root/passwords". After installing the last IMathAS and following the online note, now it works.

Thanks all