Complete PHP newbie question here,
I’m trying to load up locally a dynamic PHP site, but i get an error. I’m using EasyPhp 12.1.
the error message is:
Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'User'@'localhost' (using password: YES) in C:\Program Files (x86)\EasyPHP-12.1\www\site 2\includes\includes.php on line 3
Failed to connect to mysql database.
I should add that i got instructions for accessing the site, and these were:
- import the database (how do i do this? to where?)
- edit includes/config.php
While I don’t use EasyPHP for local development (I use Xampp) EasyPHP appears to be a very similar package. If the local site you are trying to view does not include a PHP-driven install script for setting up the tables by pointing to a particular database instance, then you will have to manually load the tables using the SQL interface. If you have not already set up the database, you’ll also have to do this. Also, you may need to configure username and password access. All of this can be done from within the PhpMyAdmin interface packaged with EasyPHP.
To reach it, first I would look at EasyPHP’s administration interface. There is probably a link or something that will take you to the MySQL admin tool. Here you can manage and configure all of your MySQL databases, including creating database table space that the local site will use.
Once the database is created, in order to import the database, it really depends on how it was given to you. If it is an
.SQLfile, you can probably just run it from within the PhpMyAdmin interface on the database instance you’ve created.This can all be done using other SQL tools (e.g. command line), but if you’re new to working with databases, PhpMyAdmin is probably a good place to start.
Finally, in your config you’ll probably have to specify:
So that it can properly connect to your database.
When in doubt, consult documentation and setup instructions for EasyPHP (and MySQL). Also, if you’re very new at working with PHP and database, you might also try setting something like WordPress up locally or some other nicely written piece of PHP software so that you can get a little more familiar with the initial set up process for databases, etc.