PDA

View Full Version : phpmyadmin access



emontage
10-08-2004, 06:19 PM
Does anyone know the way to setup new username and password for other people to access phpmyadmin. i need to get someone do some db work but obviously i cant give him root access.

thanks alot.

wildjokerdesign
10-08-2004, 08:10 PM
Access to phpMyAdmin is controlled by an .htaccess file located in /plugins/PhpMyAdmin directory if you check it you'll see the path to the .htpasswd file that it is checking. You would need to add them to that. If you open that file you'll see the format to add it. The only problem you are going to run into is that the password is encoded in that file. You could use the Password Protect program in your Site Apps to protect a dummy directory on your account and then use the info from that .htpasswd file to add to your one for phpMyAdmin. I can't really think of a simpler way to do it.

P.S. The WebPassword utility is under Tools in Site Applications and the password file it creates should be some where in /usr.local/webpasswords. You can look for the full path to it in the .htaccess file that is created in the temp directory you protect.

torrin
10-08-2004, 09:08 PM
I believe that gives them root access, doesn't it?

FZ
10-09-2004, 07:20 AM
What you should do is go into PhpMyAdmin, click Privileges > Add New User and add the person there. You may also then modify the database that the person has access to ("Database-specific privileges"), etc.

Update: Refer to Shawn's post below on how to set up PhpMyAdmin in a multi-user environment.

wildjokerdesign
10-09-2004, 07:21 AM
Well It depends on what emontage is wanting to do. When I first read the post I started to explain how to add a database user via phpMyAdmin. When I was reading back over the post I realized they where asking about logging into phpMyAdmin itself. Hmmm....

So emontage what is it you are wanting this new user to do? Maybe I was right in my thinking at first and you wanted a new MySQL user.

To do that you log in to phpMyAdmin and then go to Privlidges on the that page there is a link to a Add a new user. There you can set up a user that can only do certian things with MySQL.

wildjokerdesign
10-09-2004, 07:22 AM
FZ beat me to it. :)

wildjokerdesign
10-09-2004, 07:59 AM
Well did some searching and yes it does seem like it is possible to set up one installation of phpMyAdmin for multiple users that have access to different databases. I knew I had read stuff on it before. There is no real clear documentation on it and the one tutorial that can be found is an install done on windows system. Anyway I thought I would pass these two links on. The first is what phpMyAdmin has to say about it and the second is the tutorial:
http://www.phpmyadmin.net/documentation/#faqmultiuser
Not much on the phpMyAdmin site pretty vauge


http://articles.areontheweb.com/phpMyAdmin/
This is pretty detailed and actually tells the entire process this guy whent through to get it up and running. It does give a step by step after he describs his failures.

FZ
10-09-2004, 08:45 AM
Thanks for sharing, Shawn. Looks like the official PhpMyAdmin way is easier to do (and is obivously much more up to date than the other link).

Tom Howard
10-17-2004, 12:47 AM
I have a second site (www.site2.com) off of my account and I need to allow others to access the database for the site via phpmyadmin. Here's what I've done so far:

I've created a database and a corresponding user with privileges to the database (via the site admin's phpmyadmin).

I've uploaded the latest version of phpmyadmin to a directory on the site. I unzipped it and filled out the config.inc.php file with every reasonable configuration I could think of. I've tried it with and without a .htaccess file in the directory. However, I can't log in with any combination of username/password that I've tried. Anyone who has gotten it working care to give some pointers?

(I've considered adding another user to the .htpasswd file that lets me in to the site admin's phpmyadmin, but would that limit them to just that database? Would that even work?)

wildjokerdesign
10-17-2004, 08:30 AM
If I follow you right on your last question then I think that yes you could add them to the .htpasswd file for your main install. What you would need to do is go in and make sure that the user you are allowing in only has permissions on the database you want them to access.

Tom Howard
10-18-2004, 09:31 PM
I added the user to my .htpasspd file. Now I can get in, but even though I've restricted the user's access, the user still has full priviledges to all the databases.

wildjokerdesign
10-19-2004, 07:07 AM
I was looking at this more and was going to try and set it up on my test account but have not been able to get to it all. I think that some things have to be changed in the conf file since with the default set up it is logging in as the root user. I don't have the docs in front of me at the moment so can't be more specific. From what I gathered on it you don't use .htaccess when you want to set up as for multiple users. I am out on a job all day this week but if I can I'll try to look at it tonight when I get back in.

I belive the authin method has to be changed to http or cookies. I was going to try the http method. You do have to create a user that is used to check that log in that has Select privlidges to part of the mysql database. I had gotten that far but have not made the other changes in the config yet. I did finnally figure out that it shows what user you are logged in as at the top. It was showing root@localhost wich is what made me figure out that I was not logged in as the user I thought I was. :) It is pretty obvious don't know why I kept missing that. I'm trying to give you what I can remember off the top of my head if you want to play with it. I am going to get this going and post a "How To" just not sure how long or how fast I can get to it.