Modify the MySQL database name

Source: Internet
Author: User

The principle of modification is to create a new database and then rename all the tables. Just look at the script below. I'm going to change the name of the download database to DOWNLOADV2.

#!/bin/bashmysql-uroot-p1q2w3e4r-e ' CREATE database if not exists Downloadv2 ' list_table=$ (mysql-uroot-p1q2w3e4r-nse "SELECT table_name from INFORMATION_SCHEMA. TABLES where table_schema= ' Download ' ") for table in $list _tabledomysql-uroot-p1q2w3e4r-e" rename TABLE download. $table t o downloadv2. $table "Done


This article is from the "technology for the King" blog, please be sure to keep this source http://wangzhenyu.blog.51cto.com/2996939/1660544

Modify the MySQL database name

Related Article

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.