Bridget Jones
Bridget Jones

Reputation: 911

Easy PHP and mysql ..php cannot see database on local pc (all works on server)

I have a website written in php and mysql (written by someone else) and I need to alter it- just for your interest it is bridgetjonesart.co.uk. So I thought I would download it to my desktop pc and use easy php and mysql locally to make changes then upload it again.

I seem to have downloaded everything okay. I first just tried to run existing php using Easy Php and got

Warning: mysql_connect(): Access denied for user 'runningc'@'localhost' (using password: YES) in C:\Program Files (x86)\EasyPHP-12.1\www\backup from runningc\public_html\bridgetjonesart.co.uk\mysqlLogin\mysql_connect.php on line 6
Could not connect to database. Error

I have the sql database as a file 'runningc_bjart.sql' in the root directory but I think the php cant see it so I tried to use easy php administration, phpmyadmin and thought perhaps I should import the 'runningc_bjart.sql' file. So I tried and got an error message ...

Error
SQL query:

--
-- Table structure for table `Blog`
--
DROP TABLE IF EXISTS  `Blog` ;


MySQL said: Documentation

#1046 - No database selected

I am not sure what to try next, any help would be really appreciated. Thank you. Bridget

Upvotes: 0

Views: 2541

Answers (2)

Eduard
Eduard

Reputation: 3671

With phpmyadmin, create a new database named runningc_bjart and import the file there. Then search in your project for a config file where the db password is set and change it with your local mysql password

Upvotes: 0

Marc B
Marc B

Reputation: 360762

The error messages are VERY clear.

Error #1: You're using the incorrect credentials, or have forgotten to grant rights on your database to the credentials you're using.

Error #2: You've forgotten to set a default database, so MySQL has no idea which database it should be looking in for the table you're trying to drop.

e.g. you need

mysql_select_db('mydatabase');

or change your DROP query to be

DROP TABLE mydatabase.Blog;

Upvotes: 2

Related Questions