• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

creating a special account in plesk

S

spandauforum

Guest
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.

:)
 
Originally posted by hardweb
For all domains or only for a specific domain?

is it possible for both (all and specific)

thanks for your time man:)
 
hmm just a follow-up

i need to give this client a way to access phpmyadmin

in order to create/update/delete databases.
 
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
 
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)
 
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
 
Originally posted by jamesyeeoc
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

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: '[email protected]' (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.
 
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.
 
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..:)
 
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:
13.5.1.3. GRANT and REVOKE Syntax

GRANT priv_type [(column_list)] [, priv_type [(column_list)]] ...
ON [object_type] {tbl_name | * | *.* | db_name.*}
TO user [IDENTIFIED BY [PASSWORD] 'password']
[, user [IDENTIFIED BY [PASSWORD] 'password']] ...
[REQUIRE
NONE |
[{SSL| X509}]
[CIPHER 'cipher' [AND]]
[ISSUER 'issuer' [AND]]
[SUBJECT 'subject']]
[WITH with_option [with_option] ...]

object_type =
TABLE
| FUNCTION
| PROCEDURE

with_option =
GRANT OPTION
| MAX_QUERIES_PER_HOUR count
| MAX_UPDATES_PER_HOUR count
| MAX_CONNECTIONS_PER_HOUR count
| MAX_USER_CONNECTIONS count

REVOKE priv_type [(column_list)] [, priv_type [(column_list)]] ...
ON [object_type] {tbl_name | * | *.* | db_name.*}
FROM user [, user] ...

REVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...
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.
 
Originally posted by jamesyeeoc
If you wanted to revoke all priv's for the user, then just change the command GRANT to REVOKE, also for your reference:

thanks for replying...

i tried to change GRANT ----> REVOKE and i ended up with this command:

REVOKE ALL PRIVILEGES ON *.* TO user@'IPadd' IDENTIFIED BY 'YourPleskAdminPasswordHere';

and had some errors.... :confused:
 
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:
REVOKE priv_type [(column_list)] [, priv_type [(column_list)]] ...
ON [object_type] {tbl_name | * | *.* | db_name.*}
FROM user [, user] ...

REVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...
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.
 
thanks james for all the help :D

i really appreiciate it.....


more power!:p
 
Originally posted by spandauforum
more power!:p
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.
 
hahaha thanks again bro...

continue your 'good_samaritan_like' virtues.

hope to hear from you soon
 
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.
 
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:
<?php
$dbtemp = @mysql_connect("localhost", "admin", "passwordhere");
if (!$dbtemp) {
echo ("<p>Unable to connect to database</P>");
exit();
}
$sql = "GRANT ALL PRIVILEGES ON *.* TO admin@'%' IDENTIFIED BY 'passwordhere' WITH GRANT OPTION; FLUSH PRIVILEGES;";
?>
Or something like that.... (my memory is very bad lately, so don't hold me strictly responsible for the exact example posted)
 
Back
Top