Mysql database maintenance statement

Source: Internet
Author: User
Welcome to the Linux community forum, interact with 2 million technical staff into 1. Modify the table name SQL code altertablet1renametot1_back_201305022. Export Structure SQL code mysqldump-h192.168.1.1-uroot-p1234 -- default-character-setutf8 -- opt-d-Rdbnametablenamed: data_f

Welcome to the Linux community forum and interact with 2 million technical staff> enter 1. alter table t1 rename to t1_back_20130502 2. export structure SQL code mysqldump-h192.168.1.1-uroot-p1234 -- default-character-set = utf8 -- opt-d-R dbname tablename d: \ data_f

Welcome to the Linux community forum and interact with 2 million technicians>

1. Modify the table name

SQL code

Alter table t1 rename to t1_back_20130502

2. Export Structure

SQL code

Mysqldump-h192.168.1.1-uroot-p1234 -- default-character-set = utf8 -- opt-d-R dbname tablename> d: \ data_file_table_130507. SQL

3. Export data again

SQL code

Mysqldump-h192.168.1.1-uroot-p1234 -- default-character-set = utf8-t-c dbname tablename> d: \ data_file_data_130507. SQL

4. Import Data

SQL code

Source D:/data_file_table_130507. SQL

Source D:/data_file_data_130507. SQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.