1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Database user permissions.

Discussion in 'Plesk for Linux - 8.x and Older' started by Sanma, May 5, 2008.

  1. Sanma

    Sanma Guest

    0
     
    Hello,

    I'm new to plesk and i'm facing the problem that i have no idea of how to change the permissions to database users.
    The thing is that i need a user with full rights, and another one with read-only rights, and i don't know how to change the permissions.

    Can someone help me here?

    Thanks.


    Nick.
     
  2. soarchrist

    soarchrist Guest

    0
     
    CLI for user management

    If you're new to Plesk... are you familiar with the command line interface (SSH)? If not, you may not want to try to tackle this unless you really like to learn a lot of new things.

    My suggestion is to install a separate copy of phpmyadmin... one that allows more control and user management (although PHPmyadmin as I understand it doesn't actually create mysql users). To create mysql users, you'll likely have to do this through SSH access, hence my comment above.

    Check out this link for some interesting information concerning what you're looking for:
    http://wiki.cihar.com/pma/user_management

    Many people install a new copy of phpmyadmin anyway b/c Plesk doesn't allow you access to it outside of the control panel. Many DB users like to access phpmyadmin through a unique URL. And... it's pretty easy to install, really. Take 5-10 minutes.

    Hopefully that helps!
     
  3. Sanma

    Sanma Guest

    0
     
    But that sepparate copy wont be the same as the default phpmyadmin already installed in plesk?
    I don't really care about separate URLs, it's the same for me, i just want the user permission feature.

    If you can recommend me a program or way to do it it'd be great =)

    And yeah, i've used SSH. Before adding plesk i was like 3 weeks trying to manage with directadmin, but i figured a good control panel would be better haha.

    Thanks
     
  4. soarchrist

    soarchrist Guest

    0
     
    The separate copy of PHPmyadmin won't be the same as in Plesk... but it uses the same databases. I don't know why you wouldn't be able to use both, actually-- phpmyadmin is just an interface to the DB-- both installations would be pointing to the same mysql DB. Has anyone tried this and can confirm that both installations would work fine?.

    Are you trying to have limited user rights in phpmyadmin... or for a mysql account? or for Plesk? I don't believe you can customize user rights for plesk or for mysql... since that's like prescribing user rights access to Microsoft Excel... doesn't work. I know phpMyadmin can handle this sort of thing... and based on my other suggestion, a separate copy would have to be solution b/c the plesk version of phpmyadmin doesn't allow full config. You can't even change personal prefs.

    Check out this other forum post... good stuff.
    http://forum.swsoft.com/showthread.php?t=26159
     
  5. soarchrist

    soarchrist Guest

    0
     
    You Can Do It!

    I actually just did this very thing myself. I installed a new copy of phpmyadmin on a subdomain of my main account. I used the httpsdocs... so I got the SSL connection. I setup phpmyadmin, added an extra user to the database, and then logged into phpmyadmin with admin privs to change user priveledges. Here's a more detailed walkthrough.

    1. Download and installed PHPmyadmin.
    http://www.phpmyadmin.net/home_page/index.php
    Like I said above, I created a subdomain on my main account (phpmyadmin.<mydomain>.com). I then uploaded the phpmyadmin files into the httpsdocs folder.

    2. Prepare MySQL
    You'll need to log into Plesk and add a new database (you can do it under any domain, but I suggest your domain, not a client's). Call this database anything, like 'phpdb'. This is a database for the new installation of phpmyadmin to store it's settings and such. Also through Plesk, create a standard user for this database (ie, 'phpdb_user').

    3. Create a writable folder for phpmyadmin setup
    This is easily done through ssh. Log into SSH and browse to var/www/vhosts/<yourdomain>/subdomains/phpmyadmin/httpsdocs (or wherever you installed it).
    First you must manually create a folder config in the phpMyAdmin directory. This is a security measure. On a Linux/Unix system you can use the following commands:

    mkdir config # create directory for saving
    chmod o+rw config # give it world writable permissions

    *Don't close your ssh connection, you'll use it again


    4. Configure PHPmyadmin
    Next, open scripts/setup.php in your browser. Note that changes are not saved to disk until explicitly choose Save from the Configuration area of the screen. Normally the script saves the new config.inc.php to the config/ directory, but if the webserver does not have the proper permissions you may see the error "Cannot load or save configuration."

    Continue to add the server to the config file. You don't have to change much. I suggest using cookie authentication. You'll have to enter the database info you created in Plesk a minute ago under the phpmyadmin config db field or something. I forget exactly what its called. If you fail to enter it, it will warn you that it doesn't have a DB for preferences and stuff.

    Anyway, once you add the server, you're pretty much done configuring phpmyadmin unless you want to manually change defaults for display and such.

    Once the config file has been saved, it must be moved out of the config/ directory and the permissions must be reset, again as a security measure. Do this through SSH:

    mv config/config.inc.php . # move file to current directory
    chmod o-rw config.inc.php # remove world read and write permissions

    5. Change user accounts
    You should now be able to login to the new installation of phpmyadmin through any username/password on your server. So, your clients should be able to login and see only their databases... and likewise, you should be able to log in as 'admin' and **** and see ALL databases. Very nice if you're a web developer for these clients.

    Anyway, if you login through the admin account for your server, you can add and change user accounts. This includes creating users with limited privs.

    Final Comments
    As with almost all opensources wonders, there's tons of documentation out there on configuring your own phpmyadmin installation. The downside of this is course that Plesk doesn't interface well with phpmyadmin. Sure, the users and db show up there. However, how is a limited user going to interface with phpmyadmin? If they go through Plesk, there's nothing stopping them from using the account with higher privileges. In other words, Plesk never requires phpmyadmin users to put their passwords in... it makes you wonder why they even require you to have one (well, it's b/c mysql requires it).

    Point is, for you to implement this in a way that an actual user doesn't have the rights at all, they can't go through plesk anyway. But now you've set it up on a sub-domain which makes it darn stinkin' easy to administer. Heck, it's easier to remember than adding port 8443 on the end of the domain!

    Good luck and hopefully this is what you were looking for... if not...I may have wasted 2 minutes! :)

    Ciao!
     
  6. Wittner

    Wittner Guest

    0
     
    Excellent and exhaustive reply soarchrist! I'm having issues with this also. Why does Plesk not just allow you to set up user permissions for a DB when setting up a new DB. Doesn't make any kind of sense to me.

    Anyhow, I logged on to my server using SSH and using the command line with root permissions, I wasn't even able to log onto the MySQL, mysql database - nor did I have permissions to change/add user persmissions.

    My ISP suggested that I install a seperate phpmyadmin, but like, sounds like a *lot* of work just to add permissions since I don't normally use phpmyadmin! I have Navicat locally and can log on with that, but still no permissions to add/change users.

    Does anyone know where the MySQL permissions have been set once a new DB has been created through Plesk? Should I set up my new DB's from the command line? And if so, what is the point of Plesk in the first place?

    cheers,

    Wittner
     
  7. Wittner

    Wittner Guest

    0
     
    Found the answer

    for me at least! From the main Plesk control panel choose 'Server', then from the next screen choose 'Database Servers' - then to the right of the MySql server listing there is an icon to edit the server. Choosing this icon will fire up an instance of PhpMyAdmin with you set as root user in MySQL. This allows you to add, edit users and permissions,

    cheers,

    Wittner.
     
  8. soarchrist

    soarchrist Guest

    0
     
    Wittner is right... and if you're using a remote client software to administer the DB then you don't care about a separate install of PHPMyAdmin...

    Personally, I like the ability to customize even the look of phpmyadmin and it's access and now having it as a SSL subdomain on my host domain... it couldn't be easier/better.

    Happy scripting!
     
  9. lxhicks4

    lxhicks4 Guest

    0
     
    I love the idea of being able to manage all the databases of all my users from one location/instance of phpMyAdmin, so I tried soarchrist's instructions. However, I now have an externally accessable phpMyAdmin using the subdomain but it does not allow me to access the databases of other domains. I can only log in using the credentials I established for the phpMyAdmin configuration, phpdb_user and phpdb. What am I missing? I also get an mcrypt extension error. I have fuill access to the OS and am using Plesk 8.3.

    Thanks.
     
  10. PradeepL

    PradeepL New Pleskian

    6
     
    Joined:
    Mar 28, 2014
    Messages:
    1
    Likes Received:
    0
    Hello,
    I am new in parallel panels and I deleted the old Database User Accounts and creating the new one. The whole application is not working and gives error "Unable to connect to your database server using the provided settings". Database is in the mysql server. I am not understanding what should I do for running the my php website. Please help me.
     
  11. Kiamorning

    Kiamorning New Pleskian

    6
     
    Joined:
    Mar 25, 2014
    Messages:
    4
    Likes Received:
    0
    Hello PradeepL,
    You should wait for guidance from the senior members of the forum. I also want to learn from the problems like this.
     
  12. jack99

    jack99 New Pleskian

    6
     
    Joined:
    Apr 3, 2014
    Messages:
    2
    Likes Received:
    0
    for me at least! From the main Plesk control panel choose 'Server', then from the next screen choose 'Database Servers' - then to the right of the MySql server listing there is an icon to edit the server.
     
  13. hoanganh

    hoanganh New Pleskian

    6
    60%
    Joined:
    Feb 11, 2014
    Messages:
    5
    Likes Received:
    0
    Anyway, if you login through the admin account for your server, you can add and change user accounts. This includes creating users with limited privs.
     
  14. tuanx90

    tuanx90 New Pleskian

    6
     
    Joined:
    Apr 16, 2014
    Messages:
    1
    Likes Received:
    0
    Thanks for this topic. I'm also finding the way to solve them.
     
Loading...