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

Mysql connect remotely?

Discussion in 'Plesk for Linux - 8.x and Older' started by GeneralSquall, Oct 12, 2005.

  1. GeneralSquall

    GeneralSquall Guest

    0
     
    does anyone know how to connect to mysql on plesk remotely?

    i have these in the settings below

    $dbhost = 'x.x.x.x:3306';
    $dbuser = 'username@x.x.x.x;
    $dbpass = 'password';
    $dbname = 'database';

    and when I try i get this error.

    Warning: mysql_connect(): Host 'x.x.x.x'is not allowed to connect to this MySQL server in c:\temp\www\script.inc.php on line 30
    Failed to open database!
     
  2. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    962
    Likes Received:
    31
    Location:
    Romania
    Use Power Toys Addon.
     
  3. GeneralSquall

    GeneralSquall Guest

    0
     
    Where do I get that? and how wasy is it to install?
     
  4. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    962
    Likes Received:
    31
    Location:
    Romania
  5. tmonsen

    tmonsen Guest

    0
     
    The error you are receiving is a result of your mysql user not having the correct permissions to access mysql from your IP. By default mysql users created through psa only have access to the databse from localhost. If you add an additional user with access to mysql from your IP, you will then be able to make the connection.
     
  6. Whistler

    Whistler Guest

    0
     
    You need to setup the correct permissions on the database user and/or the host privileges.

    Have a look at the MySQL documentaion about the permission system:

    http://dev.mysql.com/doc/refman/4.1/en/privilege-system.html

    and more specific:

    http://dev.mysql.com/doc/refman/4.1/en/access-denied.html
     
  7. rvdmeer

    rvdmeer Guest

    0
     
    lvalics... why are you advising this person to buy a product while its a "simple" sql config file question? which can be solved within short notice without buying a product.
     
  8. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    962
    Likes Received:
    31
    Location:
    Romania
    rvdmeer:

    1. If you look for that Power Toys, you will see is totally FREE.
    2. If you read between line, you will see that the guy (GeneralSquall) are not very advanced in using PLESK, so probabbly don't have sufficient knowledge to enter in MySQL as ADMIN and anyway usually I do not suggest to anyone to modify advanced things if that person is not an advanced user.

    I hope this clarified your concern :)
    If you read on posts on forum, you will see how many people use Power Toys (and not only because it's free)
     
  9. Whistler

    Whistler Guest

    0
     
    Hmmmmmmmmm.... If you don't know how to enter phpMyAdmin and change/add the according mysql rules to allow access - how would you know how to access a shell, and make sure how to install PowerToys and go to the Control Panel after that to enter the information about the remote user in your interface?

    phpMyAdmin has an execlent interface to setup/grant user-access (acl) on the MySQL system.

    :)
     
  10. rvdmeer

    rvdmeer Guest

    0
     
    Ah, then i didnt say anything. my bad!
     
  11. GeneralSquall

    GeneralSquall Guest

    0
     
    Guys I have been using Plesk since it's very first release.

    unfortunately This was a very first in all my years that one of my staff members actually wanted remote access to monitor his database for personally stuff, I myself have never needed this.

    I have tried it in previous version back version 2 of plesk and didn't have to change anything in mysql to do so.

    Now I admit that I tried it with the newer plesk version again, never needed to. I do not spend alot of time on the forums as I do not have the time with my business needs as customers flow in hourly.

    But rest a sure that I am no newbie and know what I am doing. however I am probably older than most of you in this post and have been doing the business than most of you.

    Every now and than I even need to be refreshed. =)
     
  12. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    962
    Likes Received:
    31
    Location:
    Romania
    GeneralSquall: I still suggest Power Toys, will do from PLESK interface this request.
    Or you can install on a domain a phpMyAdmin and enter as admin/adminpass and add to MySQL tabel a new user and a host where this user can enter.
    Hope this help.
     
  13. Whistler

    Whistler Guest

    0
     
    Hehe, oki, but then you could just have written that :) Your post looked like you diden't know how to use the GRANT / access privelege system in MySQL, so sorry I diden't see your post as intended.

    But to answer your question then - no, it's not possible to open external access to MySQL database through Plesk. You have to manually change the MySQL user/host tables - or use a 3rd party tool like phpMyAdmin or PowerToys.

    :eek:)
     
  14. GeneralSquall

    GeneralSquall Guest

    0
     
    Thank you Whistler, It probably would have helped if I woul d have said that, lol Thanks again guys.

    Most of the time I don't need help on a subject but when I do I can always relie on my freinds here on the forums.


    DRINKS ON ME!
     
  15. wscreate

    wscreate Guest

    0
     
    For those that may find this thread via a search on the topic... connect to database from remote server, this is what I recently sent to a customer of mine who is on a Plesk 7.5 Windows server.

    Localhost is the address for local database connectivity. If you are connecting to a database on the Plesk server from a site off of the server, then you may use the main server IP #.

    For example, 111.111.111.111 (Bogus IP for public demo purposes in this forum)

    Also, you will need to grant permissions on the database you setup using PHPMyAdmin. An example grant command for MySQL would be...

    grant all on dbname.* to dbuser@'%' identified by 'dbpassword'

    So, your script on the server would have permissions granted as above allowing connections from the wildcard % meaning any remote IP can connect to your database on the server and your script OFF the server that connects to your database would have to connect to 111.111.111.111 as the database host.


    If you have a static IP on the site that you will be connecting remotely FROM, then your command could look like this...

    grant all on dbname.* to dbuser@155.231.232.232 identified by 'dbpassword'

    Whereas 155.231.232.232 is a demo IP. You would put the actual remote server IP (the server with the script on it that needs to connect remotely to the database on the Plesk server) in its place in the grant command.

     
  16. cancer10

    cancer10 Guest

    0
     
    Make sure the server firewall is not blocking the mysql port.Make sure the server firewall is not blocking the mysql port.
     
Loading...