HOW DO I: Allow remote MySQL access for one user?

Discussion in 'Plesk 6.0 Installation and 'How Do I' Questions' started by Roberto_is_C00L, Feb 9, 2004.

  1. Hi Guys,

    I have a client who needs remote mysql access enabled for his remote computer only for his one database. What is the easiest way to set this up?

    I have read these forums alot about this and cannot find a definite answer.

    Thanks in advance!
  2. mrjoe

    mrjoe Guest

    You need to add 2 records in de 'mysql' database, 1 in the 'user' table and 1 in the 'db' table, and for the the first record in the user table, you use '%' for the column 'host', so this user can access from any ip. Or if your client has a fixed ip, fill in his ip offcourse. After doing this you also need to do 'flush privileges' to get it to work.

    If you don't know how to do this, just shout :)

  3. What are the commands to all of that? Thank again...
  4. mrjoe

    mrjoe Guest

    Here is what you need to do:

    - login on SSH
    - type: mysql -u admin -p
    - enter the plesk admin password
    - type: use mysql;
    - type: insert into user (Host,User,Password) values ('<IP>','<username>',PASSWORD('<password>'));
    - type: insert into db values ('<IP>', '<databasename>','<username>', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
    - type: flush privileges;
    - type: exit;

    where <IP> is, if your client doesn't give you a fixed IP for remote access, the percentage sign, %

    Offcourse, you can check the existing records before and after entering the new data, with "select * from user;" and "select * from db;"

    Good luck!

Share This Page