Database name change

Source: Internet
Author: User

If the source database name is "SRCDB", the target database name is "Trgdb"

First create the target database:

Create Database trgdb;

To view all the table names in the source database:

Use INFORMATION_SCHEMA;

Select table_name from TABLES where table_schema= ' srcdb ';

For the table name queried above, execute the following command in turn:

Rename table srcdb.tablename1 to trgdb.tablename1;

In this way, the tables (table structure and table data) in the source database srcdb are all migrated to the target database trgdb.

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.