kmurrey
02-23-2002, 02:15 AM
I am trying to get this to work and I can't seem to understand how to do it.
I need to create two users for this database.
A standard user that has Read-Only rights.
Then further below the config file it asked you to enter a Mysql user. The only way I can get this to work is to enter Root as the user with the password.
Can anyone show me their config.inc.php file (with passwords removed) and please show me, from the command line - how to create a user with Read Only priviledges.
I went to the mysql website and couldn't find how to create a user with Read Only privildegdes.
_____________________________
Keith
Mirage-ISP
02-23-2002, 10:06 AM
Which version of phpmyadmin are you trying to set up?
I was about to start writing a step by step, then I remembered this guy.
http://articles.areontheweb.com/phpMyAdmin/
Very useful.
kmurrey
02-23-2002, 08:03 PM
I am trying to install 2.2.4.
I will look at the website you gave me and let you know how it turns out.
__________________
Keith
kmurrey
02-23-2002, 08:37 PM
I think I might be figuring this out... tell me if I am off or not.
I need to protect the directory /phpadmin/ so that nobody can just run it. To do that I add a .htaccess file to this so a certain user can only use it - the one that I defined in my phpconfig.inc file (I think that is it).
I am just curious if it is alright to use the user of root for these functions since the .htaccess will protect the directory.
But I am concerned at putting my root password in a php file - that it could be seen someone.
Am I on the right track?
____________
Keith
Chicken
02-23-2002, 09:53 PM
I may have been on track with this thread after all: http://www.webhostingtalk.com/showthread.php?s=&threadid=37282
-but anywhoooo. Re: mysql db's, I'd set up another user and a db for that user for all dbs you need. The area that contains this info should be passprotected (the config file of the script you are running, whatever it is, the one that contains the username and password).
I'm not sure exactly what you are trying to do, so again, none of this might apply.
kmurrey
02-23-2002, 10:08 PM
Chicken:
Well -the phpadmin asked for cetain password in the config files - I don't want just anyone getting to this directory so I know that I can protect it with a .htaccess file.
I am just concerned if I put the username of root and the password in the config file so that it can hit the mysql database.
_____________
Keith
Mirage-ISP
02-23-2002, 10:51 PM
Keith, it depends on the authentication method you chose.
Authentication methods available, "config, http or cookie based"
if you chose 'config" then you need to enter the mysql root password. This is not desirable however. Choose "http" and then only enter the standard username and password.
In your mysql log in as root.
CREATE DATABASE test_db;
CREATE TABLE test_db.test_table (testdb not null);
INSERT INTO mysql.user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv) VALUES ('localhost', 'foo', PASSWORD 'bar'), 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N');
INSERT INTO mysql.db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv) VALUES ('localhost', 'test_db', 'foo', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N');
FLUSH PRIVILEGES;
//you have now created a standard user named "foo" and password "bar".//
//Now in your phpmyadmin config file://
$cfgServers[1]['host'] = 'localhost'; // MySQL hostname
$cfgServers[1]['port'] = ''; // MySQL port - leave blank for default port
$cfgServers[1]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfgServers[1]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfgServers[1]['stduser'] = 'foo'; // MySQL standard user settings (this user must have read-only
$cfgServers[1]['stdpass'] = 'bar'; // access to the "mysql/user" and "mysql/db" tables)
$cfgServers[1]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
$cfgServers[1]['user'] = 'root'; // MySQL user
$cfgServers[1]['password'] = ''; // MySQL password (only needed with 'config' auth)
now clear your cookies off your browser and fire up phpmyadmin.
now if you log in as "foo" with password "bar", you can only see the test_db;
likewise, anyother user you create can only see their databases;
hope some of this works, if not send me a pm, and we can do it together to get you going.
kmurrey
02-23-2002, 11:39 PM
Finally - got it to work.
Thanks so much.
I also found the mysqlusersetup script that helped create the db - because of the error I was getting.
_____________
keith