Results 1 to 7 of 7

Thread: Database Error: Unable to connect to the database:Could not connect to MySQL

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    1

    Exclamation Database Error: Unable to connect to the database:Could not connect to MySQL

    I am getting this error while trying to access the site and and even while trying to log into administrator.

    Database Error: Unable to connect to the database:Could not connect to MySQL

    I have tried refreshing and accessing it a dozen times.
    The last thing I did was 2 days before when I changed the sites articles after which it was working fine for 2 days then suddenly I am getting this problem.


    I have searched the net and have found a solution which says that after restarting mysql in CPANEL the problem should be gone.

    I do not know the process of restarting the mysql service.


    can somebody please help me to restart mysql.
    And if anybody knows the solution to the my problem can they suggest me another method of solving(Database Error: Unable to connect to the database:Could not connect to MySQL) this problem.

  2. #2
    Registered Member cPanel Partner NOC Badge
    Join Date
    Oct 2008
    Posts
    49

    Default

    Hi;

    You can start/stop the mysql service on the server by logging into the server as root from the command line interface and run the following command/s.

    service mysql stop
    service mysql start
    service mysql restart

    You can also use the following if the above does not work fine.

    /etc/init.d/mysql start
    /etc/init.d/mysql stop
    JaguarPC
    jaguarpc.com

  3. #3
    Registered Member
    Join Date
    Nov 2008
    Posts
    6

    Default

    Mysql must have stopped functioning in the server. You can restart mysql using the command,

    /scripts/restartsrv mysql

    OR

    /etc/init.d/mysql restart

  4. #4
    Registered Member nilesh_kolte's Avatar
    Join Date
    Apr 2006
    Posts
    66

    Default

    Hello,

    Try to connect your database using the login details which you have provided in your config file. seems to be the config get mismatch.
    ~~~ Cool Buddy ~~~

  5. #5
    Registered Member don_will's Avatar
    Join Date
    Jun 2007
    Location
    Cpanel
    Posts
    62

    Default

    remember database name and username and password when you created database using mysqldatabase through cpanel.. what scripts/cms e.t.c did you install.. check the config file to match your database,username,pass, e.t.c

  6. #6
    Registered User
    Join Date
    Dec 2010
    Posts
    1

    Default Re: Database Error: Unable to connect to the database:Could not connect to MySQL

    i am getting this message...

    Database Error: Unable to connect to the database:Could not connect to MySQL

    i talked with the hostmonster live help ...he said that we only allow 15 database connections...

    My website is actually a study website http://vuzs.net and at exams days our site's number of page impression increases...and mostly i felt this problem comes at exams days...

    please help me whats wrong and how can i fix that?
    Last edited by mrfuad2007; 12-21-2010 at 09:12 AM.

  7. #7
    Registered Member twhiting9275's Avatar
    Join Date
    Sep 2002
    Posts
    369
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Database Error: Unable to connect to the database:Could not connect to MySQL

    Quote Originally Posted by mrfuad2007 View Post
    i talked with the hostmonster live help ...he said that we only allow 15 database connections...
    this is a problem you need to take up with hostmonster. They need to either up your database connections (not likely), or you need to move to a higher grade account. 15 consecutive database connections at one time isn't really horrible though, if you close your connections properly.

    cPanel can't help with individual host issues

Similar Threads

  1. Replies: 12
    Last Post: 01-06-2010, 08:54 PM
  2. cphulkd can't connect to MySQL database
    By sehh in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 08-20-2009, 08:57 AM
  3. Replies: 2
    Last Post: 06-22-2009, 08:30 AM
  4. Cannot connect to MySql Database using Dreamweaver
    By Ormus in forum Database Discussions
    Replies: 1
    Last Post: 02-18-2008, 04:58 AM
  5. Unable to connect to database
    By sony in forum Database Discussions
    Replies: 1
    Last Post: 04-09-2005, 02:03 AM
bargain