---
title: "批量修改库表字符串脚本"
author: "lean1252"
date: "2014-12-30T18:33:40Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2014-12-30T18:33:40Z"
id: 2171290
url: "https://asflex.iteye.com/blog/2171290"
---

> 生成可执行语句


```java
mysql -uroot -p67457e226a1a15bd -e 'use jira636;show tables;'|awk -F'|' '{print "mysql -uroot -p67457e226a1a15bd -e \"use jira636;alter table "$1 " default character set utf8;\""}' >[color=orange]batch_mysql_table_charset.sh[/color]
```


```java
chmod 755 batch_mysql_table_charset.sh
```



> 执行脚本batch_mysql_table_charset.sh