Web Hosting Talk







View Full Version : Anyone here that has user PHPMyAdmin?


SECUREDNETWORKS
04-07-2001, 12:25 PM
We want to offer more then just 1 database to my clients, we have been editing permissions but have not had much luck. Suggestions would be great! If a web host uses this script for their company and they have it configured to do so could you help me with the permissions side of it? Also, is their any other script that web hosts use?
Thanks!

thewebbie
04-07-2001, 12:45 PM
Hello,

If you have the phpMyAdmin working with the root user then this is what you have to do.

First you will need to create a read only user and replace the root user in the config.inc.php file for phpmyadmin. This will prevent the mysql root password from being compromised. (if you want it)

mysql -uroot -ppasswd -e"grant select on mysql.* to myadmin@localhost identified by 'pick a password not equal to mysql root' "

i.e. mysql -uroot -prootpassword -e"grant select on mysql.* to myadmin@localhost identified by 'myadminpasswd' "

edit the config.inc.php and replace the root user with myadmin and enter the myadmin passwd.

Now go to the myphpadmin page and login as root.

1) Create a database ie. customerdata
2) Choose the mysql database on the left
3) use the GRANT command in the "Run SQL Query" form field.

grant select, update, insert, delete, drop, create, index, alter on customerdata.* to customerusername@localhost identified by "customerpassword";

If you do not want them to have index then remove the index and alter.

You can now tell the customer to use customerusername and customerpassword for their database.

I found these links very helpful

http://www.mysql.com/doc/A/d/Adding_users.html
http://www.unixguru.org/howtos/mysql/userperms.html
http://www.mysql.com/documentation/mysql/bychapter/manual_Privilege_system.html
http://www.mysql.com/articles/mysql_intro.html#SECTION0002000000
http://www.unixguru.org/howtos/mysql/userperms.html
http://www.psiweb-guide.aa.psiweb.com/MySQL/user.html
http://www.phpwizard.net/projects/phpMyAdmin/
http://www.phpwizard.net/projects/phpMyAdmin/documentation.html

[Edited by thewebbie on 04-07-2001 at 03:37 PM]

SECUREDNETWORKS
04-07-2001, 01:10 PM
I have ran this on a test user and it worked fine, but it will not let the user create additional databases etc.

thewebbie
04-07-2001, 03:36 PM
Originally posted by SECUREDNETWORKS
I have ran this on a test user and it worked fine, but it will not let the user create additional databases etc.

That is correct.. If you want to allow create or give the user "root-like" permissions then give the user use:

mysql -uroot -prootpassword -e"grant ALL on mysql.* to myadmin@localhost identified by 'myadminpasswd' "

or you can give them more limited permissions by selecting the privs you want to give them:

mysql -uroot -prootpassword -e"grant select, update, insert, delete, drop, create, index, alter on mysql.* to myadmin@localhost identified by 'myadminpasswd' "

I hope this helps..

TheComputerGuy
04-07-2001, 10:38 PM
Couldnt you offer them unlimited lines, just one dB, and get this done a lot of host do this.