Renommer une base
This commit is contained in:
parent
47108f8cdc
commit
70878b936a
|
@ -345,6 +345,16 @@ GRANT ALL PRIVILEGES ON `base`.* TO 'accesbase'@'localhost'
|
|||
# mysql -e "select * from information_schema.user_privileges;"
|
||||
~~~
|
||||
|
||||
### Renommer une base
|
||||
|
||||
- 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
|
||||
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
|
||||
~~~
|
||||
|
||||
## Administration
|
||||
|
||||
On crée une base de données et un utilisateur associé :
|
||||
|
|
Loading…
Reference in New Issue