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

Wanwang virtual host local wamp database migration problem.

WBOY
Release: 2023-03-01 17:04:01
Original
1156 people have browsed it

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:

<code>MySQL Server Error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) ( 2002 )
</code>
Copy after login
Copy after login

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:

<code>MySQL Server Error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) ( 2002 )
</code>
Copy after login
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template