This error appears to be due to the configuration file of your PHP code, the connection information did not changed properly when you change the host.
First thing to do is make sure that you have change your database. Because of the security reason, most hosting service does not allow connecting to there mysql server from another location. There for, you connect to the mysql5.000webhost.com
from another server.
Second, review the code to find out which file containing the database connection information, which usually includes: database hostname
, database username
, database password
, database name
. If you use an PHP framework, check the documentation.
In general, this is what I usually do when moving a site to another host:
- Open the PHPMyAdmin in my old host control panel
- Export the full data of the current database. I usually check
DROP TABLE/DROP VIEW
option.
- Save the exported sql file to my local drive
- Open the control panel of my new host
- Finding the MySQL configuration option. You may find the MySQL host name here, usualy is
localhost
(yes, 000webhost is a special case when not use this default host name).
- Create the database and the user if necessary.
- Write the
database hostname
, database username
, database password
, database name
information properly into your php configuration file of your source code.
- Open the PHPMyAdmin in the control panel of the new host, go to my database (just created) and import the previous sql file.
If everything works well, your code may work.