Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to grant a user to create database phpMyAdmin?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to grant a user to create database phpMyAdmin?

Sorry because this likely to be offtopic..

In Virtualmin, I created a virtual server. By default, a sql database with name same like the owner of virtual server was created.

So, I want to give privilege to that user to create new database. But how to do it via phpMyAdmin with root login?

here global permission

I tried to tick CREATE, but the user can view all list of database on my server.
How to enable create while only limit him to see only db that he created?

Comments

  • Go back to the "localhost" / main page, Goto users, hit edit privileges on the user you want to add to the new DB.

    Scroll down to "Database-specific privileges"

    Choose DB, it will reload then change the privileges.

  • @ATHK said:
    Go back to the "localhost" / main page, Goto users, hit edit privileges on the user you want to add to the new DB.

    Scroll down to "Database-specific privileges"

    Choose DB, it will reload then change the privileges.

    what i want to do is to allow that user to create a new db..

    what you asking me to do is assign a new user to existing db

  • Oh yea .. what the hell did I do that for..

  • raindog308raindog308 Administrator, Veteran

    I don't know about phpmyadmin offhand, but you can give someone the ability to create databases:

    # mysql -u root -psomepass
    
    mysql> grant create on *.* to testguy@localhost;         
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> flush privileges;
    Query OK, 0 rows affected (0.02 sec)
    
    mysql> Bye
    
    # mysql -u testguy -psomepass
    
    mysql> create database frack;
    Query OK, 1 row affected (0.11 sec)
    
  • @raindog308 said:
    I don't know about phpmyadmin offhand, but you can give someone the ability to create databases:

    # mysql -u root -psomepass
    
    mysql> grant create on *.* to testguy@localhost;         
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> flush privileges;
    Query OK, 0 rows affected (0.02 sec)
    
    mysql> Bye
    
    # mysql -u testguy -psomepass
    
    mysql> create database frack;
    Query OK, 1 row affected (0.11 sec)
    

    and he can access that database after he create it?

  • raindog308raindog308 Administrator, Veteran

    psycholyzern said: and he can access that database after he create it?

    You need to be more inquisitive - try it yourself! :-)

    You can stop a user listing databases:

    http://stackoverflow.com/questions/7307782/how-to-prevent-mysql-user-from-showing-all-databases

    That took me something like 4 seconds to find with google...

  • @raindog308 said:
    That took me something like 4 seconds to find with google...

    oh sorry, I was too focus on solution that can be made on phpmyadmin.. its time to write some command on ssh then.. thanks

Sign In or Register to comment.