Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2011
    Posts
    2

    Post Unanswered: Database Error. Can someone help me please? :)

    Everytime I access the site, that error will be shown,

    Database error: cannot connect to Database
    MySQL Error
    Session halted.

    Anyone can help me with this error?
    Super thanks.


  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    the error message is telling you the application cannot connect to the database
    that could be down to anyone of a number of reasons. the most likely is going to be an incorrect userid + password or insufficient permissions for that userid for the requested actions

    1) the db isn't active ... check the server is running
    ..first off check the server is running on the computer that MySQL is installed, what you are seeking to prove is the server is active and able to receive connection requests. how you do that depends on what machine the server is running on, what access you have to it and so on.
    ..asssuming the server is active
    2) check you can talk to the server from another application (try downloading 3rd party software such as MySQL Workbench, or anyone of the many other tools such as HeidiSQL, PHPMyAdmin, modelling tools and the like) and see if you can connect to the server of the options Id strongly recommend you use workbench as it helps int he administration of the server. a problem here could be a firewall blocking connections for / from MySQL
    3) check your code, make certain the userid & password are correct, make certain the host is correctly sepcified. investigate any error logs to see if they give a clue as to whats (not) happening

    you don't give an indication of what language you are suing to connect to MySQL.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2011
    Posts
    2

    Talking

    Thanks for the reply.

    I'm using PHP to connect to MySQL.

    I'm not really good on databases.
    Hope I can get all of what you've said.
    THANKS SO MUCH.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    show us the PHP code that is falling over, but only the code that is failign we don't need to see the whole php script, just the bit that opens the the connection, selectd the db and so on
    do you use error trapping?
    do you use the "or die" construct?php or die - Google Search
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    at present I'll leave the post here, but its more likely this will be a PHP problem rather than a MySQL problem, although its probably down to the user permissions
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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