Home  >  Article  >  Backend Development  >  Wanwang virtual host local wamp database migration problem.

Wanwang virtual host local wamp database migration problem.

WBOY
WBOYOriginal
2016-12-01 00:25:361044browse

In the local WAMP environment, I created a website. The database password was set by myself at the time. The local debugging was completed, and then I purchased the Wanwang virtual host. The website file was uploaded successfully, and the sql file was also imported into the database, and there was no error. However, when accessing Site Tips:

MySQL Server Error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) ( 2002 )

It should be that the database password for local debugging is different from the database password of Wanwang. How to deal with this situation?

  1. Does the sql file exported by WAMP contain the database name and password?

  2. The local site program setting is http://localhost/website. Do I need to change the site settings when migrating to Wanwang virtual space? If so, how to modify it?

Reply content:

In the local WAMP environment, I created a website. The database password was set by myself at the time. The local debugging was completed, and then I purchased the Wanwang virtual host. The website file was uploaded successfully, and the sql file was also imported into the database, and there was no error. However, when accessing Site Tips:

MySQL Server Error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) ( 2002 )

It should be that the database password for local debugging is different from the database password of Wanwang. How to deal with this situation?

  1. Does the sql file exported by WAMP contain the database name and password?

  2. The local site program setting is http://localhost/website. Do I need to change the site settings when migrating to Wanwang virtual space? If so, how to modify it?

The configuration of MySQL is incorrect. This error is usually caused by the database not being started.
An incorrect password will not prompt this way

Confirm whether the name and password exist in the sql file, and change it to the name and password of the online environment
The domain name of the local program you mentioned? Of course the domain name needs to be changed. If the domain name is hard-coded in the program, it must be changed. Change it however you want, change it how you write it, you will definitely find a way.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn