22
0
Fork 0
This commit is contained in:
pdiogoantunes 2017-06-22 14:00:41 +02:00
parent d4612ba20c
commit b2d918ca3d
1 changed files with 2 additions and 2 deletions

View File

@ -339,8 +339,8 @@ mysql> DROP USER 'user'@'localhost';
- Créer une base vide
- Renommer toutes les tables vers cette dernière (utilisation script ci-dessous)
~~~
BASE_FROM=bf_griffe16; BASE_TO=bf_griffe16_old
~~~{.bash}
BASE_FROM=db1; BASE_TO=db2
for table in $(mysql -e "use $BASE_FROM; show tables\G;" | grep -v '^\*\*\*' | cut -d':' -f2 | sed 's/^ //'); do echo $table; mysql -e "RENAME TABLE ${BASE_FROM}.${table} TO ${BASE_TO}.${table};"; done
~~~