Remote Connect MySQL to Linux VPS PLesk

Discussion in 'MySQL' started by bersude2, Dec 9, 2008.

  1. #1
    I am trying to remote connect a database that I created within a Plesk web server to Dreamweaver, but all I get are continuous errors. "Permissions denied".

    I read that by default MySQL does not allow remote connections, but I know there are ways around this. Suggestions?
     
    bersude2, Dec 9, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    You need to add a remote user to the database. Open phpmyadmin from the database control panel. You will need to use the command line to add a user to the database. I think it's called DB Webadmin in Plesk.

    Open up a prompt and enter:

    GRANT SELECT,INSERT,UPDATE,DELETE ON *.mydatabasename TO 'myuser'@'my_ip_or_host' IDENTIFIED BY ' user_password';

    Here's the full manual on GRANT: http://dev.mysql.com/doc/mysql/en/adding-users.html
     
    jestep, Dec 10, 2008 IP
  3. bersude2

    bersude2 Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the reply, but it is still not quite working. Within MySQL I am getting error #1024 - Syntax Error.

    Here's the code I tried:
    GRANT ALL ON *.db_name* TO 'db_user'@'localhost' IDENTIFIED BY 'user_pass';
     
    bersude2, Dec 10, 2008 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    Try:

    GRANT ALL ON db_name.*

    You may not want to Grant All. This would give a user full privileges. Always grant the absolute least amount of privileges possible.
     
    jestep, Dec 10, 2008 IP