MENU service case
 Website construction website design Beijing website construction high-end website production company Shangpin China
We create by embracing change
360 ° brand value__
simplified Chinese character
Simplified Chinese English

Shangpin China Joins Hands with Beisheng Internet to Create a New Chapter in Website Construction

Type: Shangpin Dynamic Learn more

Several methods and possible problems for relocation of MYSQL database

Source: Shangpin China | Type: website encyclopedia | Time: March 19th, 2012
Beijing website construction Company Shangpin China: Website relocation is inevitable for a website, and the most important and troublesome work in website relocation is undoubtedly database relocation, because once the database file is lost and the backup source is deleted, Website production It will be a disaster, and your hard work will be wasted. So what are the methods for moving databases and what are the possible situations? Let's discuss it together.

1: Through phpmyadmin backup, you will find it troublesome to restore

Many webmasters think that the MySQL database is managed through phpmyadmin. It should be safe to use phpmyadmin for backup, right? So you are eager to enter phpmyadmin. It is always safe to do it all once, no matter whether the export is in txt or rar format, or whether you want to backup in segments? But when it comes to restoring, you will be dumbfounded. The original backup files exported through phpmyadmin can only be restored back through phpmyadmin software. At this time, you will find that this software only allows you to restore backup sources less than 2M at most. Is it troublesome? You can't find a way to break your head, can you?

Solution:

1: If the website data is less than 2M, it can be directly backed up and restored;

2: If there is more data and the backup file is too large, there are two ways to solve this problem. The first way is to backup in segments. In the backup option of phpmyadmin, set the size of each backup file to no more than 2M. The second way is to modify the software source file in phpmyadmin of the restore space to set the size of the restored file. The method can be searched online.

It should be said that this backup method is relatively troublesome, and you need to purchase your own server or vps, otherwise you don't have the relevant permissions at all, and it is generally not recommended to choose it.

2: Backup and restore through the website program's own function Website display connection error?

The website programs that are widely used by everyone now using MySQL database include DZ, PW, DEDE, etc. These programs have backup and restore functions in the background. Because of their own functions, good compatibility, convenience and rapidity, 1 they are widely selected, but when new stations grow up, they will encounter a common problem: the database name and password of the new space allocation are fundamentally different from the original database data, Can't even get into the background of the website program, how can we talk about restoring it?

Solution: Relocate in strict accordance with the website program instructions. You can reinstall the website program, and then enter the background to choose to restore the saved backup files. At present, all mainstream programs advocate this method.

3: Can't I go to the foreground for backup through software such as Backup King?

It is the choice of most old webmasters to back up with software such as Backup King. This method is convenient and fast, as long as the backup software is uploaded to the space step by step. However, many customers who have just contacted Backup King software will have a problem after restoration: because the user name and password of the database of the new and old space are not unified, and the website file has not been modified after packaging, It is good to restore the database, but the foreground will prompt the database connection error, and the website will not open.

Solution: Learn to modify the website configuration files, which are mostly controlled by the config and data.php files. Set the connection information in these files to the correct connection information to prevent the website from not opening.

4: There are hidden dangers in copying files directly in the MySQL folder

Some lazy webmasters with independent servers like to directly enter the DATA folder under the mysql folder of the server, find the database file, copy it, and then paste it into the new space. This has a big disadvantage: if the backup target database is in use, you are copying it. After pasting it to the mysql folder in the new space, the database will have errors.

Solution: We do not advocate such database relocation, which is not reliable.

After looking at four common MySQL database relocation methods and possible problems, do you feel familiar with them? It is very likely that we have all experienced some kind of situation. After reading the article today, I wonder if you have a clearer idea of database relocation? The website is our painstaking effort, and the database is the soul of the website. We must be very careful when moving the database. Finally, we carefully give you a warning: when the database is not completely restored to the new space, do not delete the database files on the original server, or you will regret if something goes wrong that cannot be remedied!

This article was published on Beijing website production Company Shangpin China //ihucc.com/
Source Statement: This article is original or edited by Shangpin China's editors. If it needs to be reproduced, please indicate that it is from Shangpin China. The above contents (including pictures and words) are from the Internet. If there is any infringement, please contact us in time (010-60259772).
TAG label:

What if your website can increase the number of conversions and improve customer satisfaction?

Make an appointment with a professional consultant to communicate!

* Shangpin professional consultant will contact you as soon as possible

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]

Communicate with professional consultants now!

  • National Service Hotline

    400-700-4979

  • Beijing Service Hotline

    010-60259772

Please be assured to fill in the information protection
Online consultation

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]