You said your client has given you all the files of her site.
So let’s confirm that.
Do you have WordPress files? Lots of PHP and CSS files, organised in folders with names like wp-admin, wp-content and wp-includes?
Also, do you have the MySQL data? WordPress stores all the posts and pages in a database, not in PHP files.
If so, have you created a MySQL database locally and imported that data yet? Then changed the database connection details in wp-config.php? If not, you are bound to get “Error establishing a database connection”.
Thread Starter
a22mu
(@a22mu)
Hello and thanks for the response. I have wordpress files in the folders as you said.
How would I know if I had MySQL data, what extension or folder would that be in. I do not think I have it as the files I have are all identical in name to the files that I downloaded for initializing wordpress on my local host. I have created a MySQL database but haven’t imported any data as I don’t think I have it.
How can I confirm if I have the SQL data?
Databases are managed by MySQL and are completely independent of WordPress. Your client would have had to create a DB backup, and then provide the backup separate from the WordPress files.
You should ask your client whether they created a DB backup I suspect they did not, and you will not be able to do anything until you import that backup database into your own MySQL insallation.
Thread Starter
a22mu
(@a22mu)
Okay, I understand. I have emailed my client and asked her for the database information.
Thread Starter
a22mu
(@a22mu)
Okay, I have the database and have imported it. I changed the WPconfig file to the new database name and made the sure the password was right. I went into the Wp_options folder in the database and set the URL to the local host folder. However when I try to connect I get a “This site canβt be reached localhost refused to connect.”
I just want to get into the site so I can edit it π
Did you set the correct database information in the wp-config.php file? Note that database users are separate from databases; if you did not create a database user yourself, you’ll need to do so.
Thread Starter
a22mu
(@a22mu)
How do I create a database user? I installed the database and have a root user account.
I have the SQL data and the wordpress site data (with wp folders) what else do I need?
Thread Starter
a22mu
(@a22mu)
I created the user and added it to the wp-config file and it still doesn’t work π
She was doing it on a mac and I am on windows
You never mentioned which local server you are using, assuming you are using one. Try it with using the local server’s default DB user and pwd. These are what I always use with any of them.
Here are the Default Database Users and Password for the popular local servers for Windows:
XAMPP: User: root Pwd: <empty> do not type anything between the single quotes when editing the wp-config.php; but LEAVE the single quotes!
WAMP: User: root Pwd: <empty> same as above
MAMP for Windows: User: root Pwd: root
Uniform Server: User: root Pwd: root
Cheers!
Lyle
Thread Starter
a22mu
(@a22mu)
Hello, I am using WAMP. I can get into MYphpadmin and have created the database and stuff using root. The problem is connecting the database and the site I think.
OK, then if you are using WAMP, this is what the wp-config.php file entries should be on your WAMP install:
Database Name: whatever the db name is; should have no spaces
User Name: root
Password: <empty>; will look like this ” <two single quotes>
Database Host: localhost
Table Prefix: whatever the existing one is; leave as-is
Did you give the user access to the database? That must also be done.
And one should always use 127.0.0.1 for DB_HOST on Windows systems; the Windows versions of MySQL and MariaDB have difficulty resolving localhost and DB access can be very sluggish. (The best DB access method in Windows is via named pipes, but that’s well beyond the scope of this site.)
Thread Starter
a22mu
(@a22mu)
I have set my config file like that but it won’t open. I also changed the file to the name of the specific database I have linked with the site and the user but still it doesn’t open. It won’t even connecting through the localhost to the folder that contains it (“localhost/testing123”)
Thread Starter
a22mu
(@a22mu)
Yes, the user has access to the database
Thread Starter
a22mu
(@a22mu)
The localhost works when I go to just the normal wordpress installation I did but when I try to go to even the folder that contains it for her site it doesn’t open at all and gives me the error