Home > Database > Mysql Tutorial > Mysql删除表名中有特殊字符的表_MySQL

Mysql删除表名中有特殊字符的表_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:26:51
Original
1430 people have browsed it

bitsCN.com

由于公司业务和应用的调整,之前在Mysql中的很多表都不需要了,故需要对数据库进行整理。

刚开始,我在想:不就删除一些表吗?很好解决,写个简单的脚本就可以了。我先看了数据库中有80000多个表,很多表都是以IP命名的,而这些表就是要清理的对象。

于是我使用下面一条命令,先将所有表名导出到一个文件中:

mysql -uroot -p123456 -A -e "use cdn;show tables;" >allDBName.txt

然后,执行:cat allDBName.txt|grep "^[0-9]/{1,3

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template