Helpful Information
 
 
Category: PHP / MySQL
Adding users to PhpMyAdmin

I was wondering how I could add users to beable to login to PhpMyAdmin and use it.
Thanks for the help.

phpMyAdmin uses a .htaccess file to authen users that is pointed to a .htpasswd file. You can find the path to that file in the .htaccess file. You would need to add the user and password to that .htpasswd file.

If you want to restrict how they can use phpMyAdmin you can check the documentation on it at http://www.phpmyadmin.net/home_page/docs.php

I think the docs are also in the phpMyAdmin directory.

Ok, but the password is encrypted, any clue on how to encrypt the password?

never mind, i googled it

Cool let us know if you have any other problems! There are tons of programs out there you can use to encrypt the password. You also have one that does it in your SiteManager at least for password protecting a directory. You can get clues from it.

Use the htpasswd program to create a .htpasswd file. If you use the correct options, it will encrypt the password for you. For options, log into a westhost server and just type htpasswd. For some reason, it doesn't seem to have a man page. Here is how I would do it. Change the that directory and run.


htpasswd -cm .htpasswd torrin

change torrin with whatever user name you want to use. Then to add more username . . .


htpasswd -m .htpasswd wildjoker

change wildjoker with whatever user name you want to use.

torrin,
So the first creates the .htpasswd file and the second code would add a user to an existing .htpasswd file of the directory you are in right? Would all the users be using the same password or do you specify a different password for each using this method?

That's correct. The "-c" options makes it create the file specified. It will also overwrite a file that is already there, so use it with caution.

Also, each one of those commands will ask for a password, so each user will have a different one, unless you specify the same. Give it a try.

Here is the man page from apache 1.3 . . .
http://httpd.apache.org/docs/programs/htpasswd.html










privacy (GDPR)