Database Error: Unable to connect to the database:Could not connect to MySQL
Posted by: Superman (---.umts.vodacom.co.za)
Date: September 28, 2010 04:47PM

hi

this is a message from me to my hosting company

(ME)
The problem I have is the database I exported from my pc (using WAMP Server) has somehow corrupted everything... the database is there, but as soon as I want to view the site through WAMP it comes with an error Database Error: Unable to connect to the database:Could not connect to MySQL

This all happened after I exported the database to load to the FTP site... I'm not sure what has happened but I'll attached the sql file I exported originally.


(HOSTING COMPANY)
I have tried importing your database file, however it is giving an error. It appears your.sql file tries to create a database in line 22.
Please ensure that you are creating the .sql file correctly. If you are exporting it, it should be exported with add drop tables.



in a nut shell.... i created a datanbase and worked off it for a month noooo problem... straight after exporting to hand over to hosting company i could not access it through localhost...

please i need help as my heart is sitting in my throat because i dont know if my work is gone!!

Options: ReplyQuote
Re: Database Error: Unable to connect to the database:Could not connect to MySQL
Posted by: Superman (---.umts.vodacom.co.za)
Date: September 28, 2010 05:00PM

i've even gone as far as trying to import the localhost.sql file i exported from the beginning to see if it would help and the message i get is this:

Error
SQL query:

--
-- Database: `mysql`
--
CREATE DATABASE `mysql` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;


MySQL said:

#1007 - Can't create database 'mysql'; database exists

Options: ReplyQuote
Re: Database Error: Unable to connect to the database:Could not connect to MySQL
Posted by: toivo (203.19.130.---)
Date: October 01, 2010 02:31PM

As the message says, the database called mysql already exists. You neeed to dump your database using a different name because the name mysql is reserved by the mysql server for its own use.

toivo
Sydney, Australia

Options: ReplyQuote
Re: Database Error: Unable to connect to the database:Could not connect to MySQL
Posted by: yfastud (Moderator)
Date: October 01, 2010 05:05PM

or to be exact, you should NEVER export mysql db, but ONLY export the db that is associated w/ your script

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote


Sorry, only registered users may post in this forum.