当前位置:Gxlcms > 数据库问题 > mysql修改库名

mysql修改库名

时间:2021-07-01 10:21:17 帮助过:12人阅读

!/bin/bash # 假设将sakila数据库名改为new_sakila # MyISAM直接更改数据库目录下的文件即可 mysql -uroot -p123456 -e create database if not exists new_sakila list_table=$(mysql -uroot -p123456 -Nse "select table_name from information_schema.TABLES where TABLE_SCHEMA=‘sakila‘") for table in $list_table do mysql -uroot -p123456 -e "rename table sakila.$table to new_sakila.$table" done

mysql修改库名

标签:直接   ase   data   数据库   where   color   done   sql   lis   

人气教程排行