Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2004
    Location
    New Jersey
    Posts
    113

    Granting MySQL command line permissions to a user?

    Is there any safe way to grant command line permissions to a user/specific account? One that only allows them access to databases on their account.

    The problem is that this user intermittently runs queries that cause their database to hang (including PHPMyAdmin, so they can't view the processlist through there), and I have to manually kill that process, because they can't.

    Server is 2.4.21 with MySQL 4.0.27, admin is cPanel WHM.

  2. #2
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,771
    You mean to give remote mysql connection to the database? It is possible add the ISP IP of the user in the cpanel mysql access_hosts list.
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  3. #3
    Are you wanting to allow the user access to command line abilities so they can fix the database? All they need to do is either edit it in phpmyadmin or download the .sql file and use an outside program to fix the database. They shouldn't need to do into shell to do that.

  4. #4
    Join Date
    Nov 2004
    Location
    New Jersey
    Posts
    113
    Quote Originally Posted by david510 View Post
    You mean to give remote mysql connection to the database? It is possible add the ISP IP of the user in the cpanel mysql access_hosts list.
    Not exactly; they have shell access, and I want them to be able to execute MySQL commands through command line (but only on databases on their account).
    Quote Originally Posted by FirmbIT View Post
    Are you wanting to allow the user access to command line abilities so they can fix the database? All they need to do is either edit it in phpmyadmin or download the .sql file and use an outside program to fix the database. They shouldn't need to do into shell to do that.
    The problem is that the database is hanging - it can't be read/written to in PHP, and also phpMyAdmin doesn't work for that database. It's because some query is causing a problem, and killing that query solves the problem, but this only seems possible from command line.

    What sort of other outside program would work here? The database seems inaccessible via PHP, so I'm not sure what might work.

    Thanks for the responses.

  5. #5
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,771
    What I was mentioning was, if the user has got remote mysql connection, he can connect to the mysql prompt from a local machine shell using the following command and execute mysql queries. Here no shell access is needed for the account. I hope this helps.

    mysql -h domainname(or ipaddress) -D databasename -u username -ppassword
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  6. #6
    if they have shell access and can't run mysql command already there is problably permission problem? If you want only certain users to run mysql just add them to specific group say 'mysqlallow' and change group owner for mysql to that group and make it +x for the group. so all 'mysqlallow' group members will be able to execute the command from this point.

    to limit access to certain databases is mysql job and should be handled by mysql client itself. (valid mysql user/pass), given the fact you added mysql users properly and assigned proper databases to them.

  7. #7
    Join Date
    Nov 2004
    Location
    New Jersey
    Posts
    113
    Quote Originally Posted by david510 View Post
    What I was mentioning was, if the user has got remote mysql connection, he can connect to the mysql prompt from a local machine shell using the following command and execute mysql queries. Here no shell access is needed for the account. I hope this helps.

    mysql -h domainname(or ipaddress) -D databasename -u username -ppassword
    Yes that's it, thanks a lot for the help

  8. #8
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,771
    You are welcome. Glad to hear it helped
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •