Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2007
    Posts
    69

    Failed To Connect To Database

    Hi Guys,

    I have 2 VPS, one has cPanel/WHM installed which is where my script is at. The other VPS has DirectAdmin installed which is where my SQL database is held. I have setup everything and placed the IP of the DirectAdmin VPS and entered the correct login information for the cPanel VPS to login to the MySQL Database on the DirectAdmin VPS.

    How ever i keep getting this error:
    Error msg: Unable to connect to the database. Please make sure the database information specified in admin/includes/config.php are correct.
    What tests can i do in SSH to see if the cPanel VPS can connect and login to the MySQL Database that way and if not how do i find out why its not allowing access? I can ping the DirectAdmin VPS in SSH when connected to the cPanel VPS.

    The reason i am having the MySQL database on the DirectAdmin VPS is because thats all the VPS will be used for (SQL Server and because DirectAdmin doesnt use as much resources compared to cPanel/WHM).

    Any help would be great.

    Thanks

  2. #2
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,849
    Did you enable remote access to the database, on the DA server? By default only local database access is allowed. You'll also need port 3306 open in the firewall.

    Quote Originally Posted by Standup Media View Post
    What tests can i do in SSH to see if the cPanel VPS can connect and login to the MySQL Database that way and if not how do i find out why its not allowing access? I can ping the DirectAdmin VPS in SSH when connected to the cPanel VPS.
    Code:
    telnet daserver.com 3306
    should get you some garbled text with "MySQL versionnumber" somewhere near the beginning.
    Code:
    mysql -uusername -p -h daserver.com databasename
    should prompt you for the password and then connect.

    The reason i am having the MySQL database on the DirectAdmin VPS is because thats all the VPS will be used for (SQL Server and because DirectAdmin doesnt use as much resources compared to cPanel/WHM).
    Up to you, but DA's resource usage is much the same as cPanel's and both are heavily dependent on your exact configuration. For a database-only server I'd just use a bare distro eg. CentOS or Debian, depending on your preference. Without all the other standard apps (Apache, BIND, exim, spamassassin etc.) you'd save a lot of memory compared to a standard install of either DA or cPanel.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

Similar Threads

  1. rndc: connect failed
    By Spitfired2s in forum Hosting Security and Technology
    Replies: 5
    Last Post: 12-22-2009, 08:25 PM
  2. whmcs connect driectadmin Failed,help!
    By myrte in forum Hosting Software and Control Panels
    Replies: 3
    Last Post: 12-16-2009, 10:34 AM
  3. Database Connection Failed -- Database missing, did I just get hacked?
    By LockerroomMarketing in forum Hosting Security and Technology
    Replies: 4
    Last Post: 11-25-2009, 04:02 PM
  4. Connect to MySQL failed (ASAP please!)
    By andrewfayor in forum Hosting Security and Technology
    Replies: 3
    Last Post: 03-21-2002, 04:16 AM

Posting Permissions

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