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

creating a special account in plesk

Discussion in 'Plesk for Linux - 8.x and Older' started by spandauforum, Sep 15, 2005.

  1. spandauforum

    spandauforum Guest

    0
     
    hello there guys.....

    i got a question/problem.

    i have a plesk software on my server

    is this possible:

    need to create/add a special kind of client

    wherein this client ONLY have a specific permission

    that is to create/edit/delete databases.

    thanks in advance for your help and suggestions.

    :)
     
  2. hardweb

    hardweb Guest

    0
     
    For all domains or only for a specific domain?
     
  3. spandauforum

    spandauforum Guest

    0
     
    is it possible for both (all and specific)

    thanks for your time man:)
     
  4. spandauforum

    spandauforum Guest

    0
     
    hmm just a follow-up

    i need to give this client a way to access phpmyadmin

    in order to create/update/delete databases.
     
  5. spandauforum

    spandauforum Guest

    0
     
    honestly there are two things i wanna do...

    1.) set user accounts in my plesk 7.5 reloaded granting these
    accounts ability to add/edit/delete their own database in my
    server

    2.) need to find way for my script (PHP) residing from
    other domain to access the particular db in my plesk server.


    (my web server ) --------accessing--------> (remote DB)

    thanks
     
  6. jamesyeeoc

    jamesyeeoc Guest

    0
     
    For phpMyAdmin, I believe you would have to setup separate copies (in each domain) and edit the config.inc.php (I think that's the name), there are 3 config items to change:

    Code:
    $cfg['Servers'][$i]['user']          = 'username';      // MySQL user
    $cfg['Servers'][$i]['password']      = 'userpassword';          // MySQL password (only needed
                                                        // with 'config' auth_type)
    $cfg['Servers'][$i]['only_db']       = 'somedatabasename';          // If set to a db-name, only
                                                        // this db is displayed in left frame
                                                        // It may also be an array of db-names, where sorting order is relevant.
    
    The 'username' can actually be whatever user was created when the package was installed (such as osCommerce, osTicket) to administrate that particular database. Otherwise you will have to create the user/pass in the mySQL database and make the appropriate changes to it's tables and priv's etc (much more messy).

    Since they will be in separate domain folders, when a particular domain user browses to that URL:

    https://www.example.com/phpMyAdmin

    (hopefully password protected directory...! Adds login prompt, and is much safer IMO)

    They have to authenticate the protected dir prompt, then phpMyAdmin will open up and only show them the singe database you specified (or the array of databases), it will have connected to mySQL using the ftpusername and password you configured in that particular directory.

    Access to (remote DB) -I assume you mean not on the same server. As long as the remote server has mySQL setup for remote access and port 3306 is open in the firewall, you should be able to connect to the mySQL on the remote server. For more information, please search the forums (mysql, 3306, remote, etc)
     
  7. jamesyeeoc

    jamesyeeoc Guest

    0
     
    Another possible alternative would be to look at how Plesk setup the config.inc.php for the control panel version of phpMyAdmin. It's kept at:

    /usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/config.inc.php
     
  8. spandauforum

    spandauforum Guest

    0
     
    hi there james thanks for taking your time off ...

    im having a hard time configuring MySQL to allow remote access, i dont know exactly where will i write these lines on the terminal:

    GRANT ALL PRIVILEGES ON *.* TO USERNAME@IP IDENTIFIED BY "PASSWORD";

    im getting error on my script that says:

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'lawrence@210.4.48.185' (Using password: YES)

    i tried to use putty on ssh and accessed my server through its terminal but to no avail...

    hope u can give me some 'idiot' like stepbystep way to
    grant remote access permission to a mysql server

    thanks again james.
     
  9. jamesyeeoc

    jamesyeeoc Guest

    0
     
    Once you have connected to the server, and logged in as root you would then login to mysql.
    Code:
    mysql -uadmin -p`cat /etc/psa/.psa.shadow` mysql
    You will then be at the 'mysql>' prompt.

    At this point you would issue your command(s), remember to put a semi colon at the end of each command line.
    Code:
    GRANT ALL PRIVILEGES ON *.* TO USERNAME@IP IDENTIFIED BY "PASSWORD";
    
    To exit mysql, use the 'quit' command.

    Note: "-p`cat /etc/psa/.psa.shadow`" can be used, or since you'll be typing at the command prompt, just type your root password.
     
  10. spandauforum

    spandauforum Guest

    0
     
    thanks james.. its working well...

    just a follow up question...

    if i decide to cut the privileges for this user@ipadd

    how can i reverse/inactivate the effect of this line

    GRANT ALL PRIVILEGES ON *.* TO admin@'%' IDENTIFIED BY 'YourPleskAdminPasswordHere' WITH GRANT OPTION;


    thanks for the help.

    i really appreciate it..:)
     
  11. jamesyeeoc

    jamesyeeoc Guest

    0
     
    If you wanted to revoke all priv's for the user, then just change the command GRANT to REVOKE, also for your reference:

    http://dev.mysql.com/doc/mysql/en/privileges.html

    Or if you wanted to revoke particular privileges, not all, then the command can be modified to a REVOKE command according to the following syntax:
    Their reference manual is quite complete, many options, but is a wealth of information.

    The other option, if a GUI is better for you, try installing phpMyAdmin on your main domain.
     
  12. spandauforum

    spandauforum Guest

    0
     
     
  13. jamesyeeoc

    jamesyeeoc Guest

    0
     
    Sorry, what I meant was to use a REVOKE command. The Revoke command has a slightly different syntax than the Grant command, which is why I posted the link. This is a snippet from that link's page:
    And, of course, this assumes you are logged into mysql as admin.

    Since you posted the original GRANT command, I assumed you would be able to figure out the equivalent REVOKE command, but just didn't know which 'command' to use.
     
  14. spandauforum

    spandauforum Guest

    0
     
    thanks james for all the help :D

    i really appreiciate it.....


    more power!:p
     
  15. jamesyeeoc

    jamesyeeoc Guest

    0
     
    Knowledge is Power, but too little (and sometimes too much) may not be a good thing LOL. Moderation is the key to success and a happy life IMO. Too bad I do all things in extremes........I have not learned to take my own advice.
     
  16. spandauforum

    spandauforum Guest

    0
     
    hahaha thanks again bro...

    continue your 'good_samaritan_like' virtues.

    hope to hear from you soon
     
  17. spandauforum

    spandauforum Guest

    0
     
    hi there james i got a followup question hope you can
    give your time again on this one

    im planning to

    write a PHP script that will run this mysql query:

    GRANT ALL PRIVILEGES ON *.* TO admin@'%' IDENTIFIED BY 'YourPleskAdminPasswordHere' WITH GRANT OPTION;

    FLUSH PRIVILEGES;

    i will make my connection string: admin,adminpassword


    will this be possible?

    thanks again man.
     
  18. jamesyeeoc

    jamesyeeoc Guest

    0
     
    AFAIK it should be possible to do this in a php script, it is a valid mysql command. You just have to make sure the user specified is either created first, or already exists (AFAIR). Brief example:
    Or something like that.... (my memory is very bad lately, so don't hold me strictly responsible for the exact example posted)
     
Loading...