If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Database Error. Can someone help me please? :)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-04-11, 21:46
moodykakai moodykakai is offline
Registered User
 
Join Date: Sep 2011
Posts: 2
Post 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.

Reply With Quote
  #2 (permalink)  
Old 09-05-11, 04:28
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 09-05-11, 09:07
moodykakai moodykakai is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 09-05-11, 09:15
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 09-05-11, 09:16
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On