0
votes

I know there are a lot of similar posts with this but I can't seem to find the answer. I was uploading my WordPress files in the newly created directory in FileZilla. Everything was successful. I exported my database from localhost and imported it to cPanel. When I opened the Website URL given by ByetHost, it was a congratulation message. So I added a /wordpress in the URL and it redirected me to the Home Page. When I was trying to click another page, an error occured: "Error establishing a database connection". When I looked at the address bar, the link was still in localhost, like localhost/wordpress/hobby. I have changed my wp-config.php credentials with what ByetHost has given me. Even when logging in, the database error is still there. I tried doing the wp-admin/install.php, it told me I installed it already but the database error comes out when I try to login. Please help the beginner, thanks!

4

4 Answers

0
votes

It sounds like you're running into a common pain point with local sandbox development and production server deployment.

The short story is that your database has "localhost" references in various records throughout. Once it's deployed on your production server, and you attempt any connections at "yourdomain.com", the system has a conflict between the URL and the records in your database.

The Codex has a good article on how to migrate an installation when the domain name changes. (Which is essentially what you're doing).

0
votes

i think you need to change url in database , url are stored in wp_options table 'siteurl' and 'home' siteurl

if you have hardcore urls in project , then after changing url in wp_options table , you can use update url plugin to update the urls.

hope this will help you

0
votes

You need to make sure to change the site url and wordpress url in the Settings page before exporting the database. This should prevent any issues.

When logged in try updating your permalinks. Also, if you have added custom menus or links be sure to update these as well.

0
votes

After I have installed few plug-ins I got this error. Try to uninstall several plug-ins. You can use "Plugin Performance Profiler" for check huge MySQL quire generating plug-ins.