Hello,
I not sure how to handle this situation.
Its a bit of read ,
I have website running PHP and MYSQL.
The database is called CollectDb
Visitors to the website sign up for newsletters and buy products.
For these users I have a user defined in the mysql.users database table with a anonymous password .
Eg.
User webuser Password webuser
This webuser has privileges to INSERT, SELECT on some tables on my CollectDb database.
So when they access pages on the site, they use the webuser username/password for any database functions.
I understand the above is correct way to handle web users?
Ok, now I have an administration section of the website.
Only the administrator is permitted to perform certain functions on the database.
So for this I added another user to the mysql.users database table.
CollectAdmin with a real password.
Now when I first create the CollectDb database, it adds a table AdminUsers and places
The Admin and MD5 of the password in this table.
Ok, so when the Admin logs in, first I connect to mysql using the Admin username /password.
Then open the CollectDb and test it again against the CollectDb.AdminUsers table. To verify its an admin for the database.
Now this works well until I need to handle a Change Password for the Admin.
I dont have access the mysql.users table. As noted in Chapter 6 of the mysql manual its not a good idea to do this.
But I need to be able to change the admin password from a webpage.
Any suggestions welcome.
Perhaps I have complicated the design by having a separate user for connecting to the database for administrive functions.
But the admin users has alot more rights to tables in my database.
Regards
Bob