Koozali.org: home of the SME Server

running phpmyadmin not as admin

bhanegraaf

running phpmyadmin not as admin
« on: June 21, 2005, 12:04:01 PM »
Hi

I downloaded phpmyadmin and installed it.
Now I'm able to run https://<ip-sme-server>/phpmyadmin only when logged in as admin.
But I want to be able to run phpmyadmin as another user who is responsible for his database.

To accomplish this I did the following:
1) I changed in config.inc.php ["auth_type"]='socked'
2) restart httpd
3) create a mysql database & granted rights to user testdb
    #mysqladmin create testdb
    #mysql
    >grant all on testdb.* to testdb@localhost identified bij testdb
    >flush privileges
    > quit
 4) create a user testdb with password testdb with http://<ip-server>/server-manager
 5) when running https://<ip-server>/phpmyadmin and try to log in with username testdb
     and password testdb the login-window repeats going blank and asking for a username and password.
     In the /var/log/httpd/error_log there is a line "access to /phpmyadmin for testdb failed"
     so I guess somewhere else I have to set rights for user testdb, but I don't know where.

Hope anyone can help me futher.

Offline Smitro

  • *
  • 350
  • +0/-0
running phpmyadmin not as admin
« Reply #1 on: June 21, 2005, 11:45:08 PM »
I have done this a while ago without any problems. As it has been a while hopefully I don't miss anything.

This is the line in the config.inc.php:
Code: [Select]
$cfg['Servers'][$i]['connect_type']  = 'tcp'; tcp not socket

And this one:
Code: [Select]
$cfg['Servers'][$i]['auth_type']     = 'http';

Also so they can change their password:
Code: [Select]
$cfg['ShowChgPassword']       = TRUE;

I think that's it, nothing real interesting...

I logged in as admin or root (can't remember, there is posts on how to log in for the first time)

I then created my self and user with admin rights.

I then logged in as that user. Created a Database for one of my users. Then went to priviliges created a user with no rights. Then went into the users account and created "Database-specific privileges" and granted "SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER" rights to that user on their database.

Went back to the main page, reloaded mysql.

And Done. Happy Days.

I think that was it. As I say it has been a while since the initial setup but I've setup several databases and users with access only to their database recently.

You can do the same thing using the commandline SQL, but I figure why bother, with the GUI you don't have to worry about spelling and correct syntax  :-)

HTH
.........

bhanegraaf

running phpmyadmin not as admin
« Reply #2 on: June 22, 2005, 08:24:07 AM »
I found the solution.
In httpd.conf there is a section <Directory /opt/administration phpmyadmin>

In this section there's a line

require user admin

This line prevents that nobody else is able to run phpmyadmin.

Changed the line in

require user admin testdb

and restarted httpd, and from then user testdb was able to log in

Only problem is testdb can see all databases, I guess this has to be configured in config.inc.php

Offline Smitro

  • *
  • 350
  • +0/-0
running phpmyadmin not as admin
« Reply #3 on: June 22, 2005, 11:30:10 AM »
Interesting responce, I know I didn't do that.

And None of my users are able to see others databases, only their own.

Your user authentication, Are you authenticating against your Linux user DB or your MySQL db?

All of my users have a seperate account in MySQL.
.........

Offline raem

  • *
  • 3,972
  • +4/-0
Re: running phpmyadmin not as admin
« Reply #4 on: June 22, 2005, 11:33:41 AM »
bhanegraaf

I thought there was a recent phpmyadmin contrib that did allow user access and limit their access to defined databases.
Search for a different version.
...

bhanegraaf

running phpmyadmin not as admin
« Reply #5 on: June 22, 2005, 11:53:56 AM »
the user testdb is created in mysql as well as in the system.
I'm using the latest phpmyadmin version which is e-smith-phpmyadmin-2.6.0-12.noarch.rpm, and the sme-server version=6.01

Offline Smitro

  • *
  • 350
  • +0/-0
running phpmyadmin not as admin
« Reply #6 on: June 22, 2005, 12:39:35 PM »
My Apologies. I installed phpMyAdmin from their web site, I didn't see the reason for the rpm. It's just a matter of download it and copy it onto an Ibay. And then  do some slight configurations in the above mentioned file. I don't think I can help you with this rpm, because I have never used it.
.........

Offline raem

  • *
  • 3,972
  • +4/-0
Re: running phpmyadmin not as admin
« Reply #7 on: June 22, 2005, 12:43:33 PM »
bhanegraaf

> I thought there was a recent phpmyadmin contrib

Perhaps this is what I rememebr reading
http://forums.contribs.org/index.php?topic=26326.0
...