Bulk Delete and modify MySQL tables for specific prefixes

Source: Internet
Author: User

Bulk delete a specific prefix table

First step: Assemble SQL statements

Select CONCAT (' drop table ', table_name, '; ') From Information_schema.tables Where table_name like ' ca_% ';


650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/00/48/wKiom1majyzxbuLhAAAcE0BJqZk929.png "title=" 2017-08-21_153020.png "alt=" Wkiom1majyzxbulhaaace0bjqzk929.png "/>


The second step: the contents of the red box selected copy and paste execution can be

Tip: To uncheck the vertical bar (|), ALT + the left mouse button is a column selection so you can check the contents of the red box



Bulk Modify Table prefixes

First step: Assemble SQL statements

Select Concat (' ALTER TABLE ', TABLE_NAME, ' Rename to Cj_ ', substring (table_name,5), '; ') from Information_schema.tables Where table_name like ' xws_% ';


The second step: check the copy and paste results, execute can


This article is from the "Technology" blog, so be sure to keep this source http://hywds.blog.51cto.com/13158032/1958058

Bulk Delete and modify MySQL tables for specific prefixes

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.