Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    1

    Default Allow External MySQL connections

    I'm trying to connect to a database on a server running CPanel from my desktop. When I try to connect I get the error
    Code:
    Warning: mysql_connect(): Host 'my.hostname.here' is not allowed to connect to this MySQL server
    How do I allow hosts to connect to the server? I have access to CPanel and WHM but not root SSH.
    -Sam

  2. #2
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,066

    Default grant to user@host

    You will need to grant access to the user at your desktop system's IP address. Currently, access will be granted only to the user at either localhost, 127.0.0.1, or the server's hostname.

    The basic syntax would be like this:

    Code:
    GRANT ALL ON mydb.* TO 'someuser'@'somehost';
    Where mydb would be your database name, someuser would be the user that already has access to the database, and somehost is your desktop's IP address. You can verify the public IP address that the server will "see" from your desktop by browsing http://www.cpanel.net/apps/myip/.

    You can enter this either at the MySQL CLI command prompt or in phpMyAdmin.

    I recommend the following section of the MySQL manual, which explains the GRANT command in detail:

    MySQL :: MySQL 5.1 Reference Manual :: 12.4.1.3 GRANT Syntax
    For hands-on assistance, please reference our new support information page: Where should I go for support?
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation


    -- Jared Ryan, Technical Analyst, cPanel Technical Support

Similar Threads & Tags
Similar threads

  1. Allow External MySQL connections
    By samarudge in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-29-2010, 08:26 AM
  2. Replies: 0
    Last Post: 10-26-2009, 09:06 AM
  3. cPanel/WHM not accepting external connections
    By BNI|Zach in forum New User Questions
    Replies: 4
    Last Post: 04-14-2008, 09:58 AM
  4. Mysql - Too many connections
    By ialex03 in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 04-29-2005, 10:11 AM
  5. Globally block connections to mysql from external sites
    By redlorry919 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 04-19-2005, 11:30 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube