mysqlのDB名を変更する

mysql:8683

MySQLのMLにこんな話題が。

データベースの名前を変更させたいのですが、なにかmysqlのコマンドがあるのでしょうか?

DB名を変更したくなる時が年に2度くらいあるものです。

賢者曰く、

手元にあった 4.0.17 の manual.txt を見たら、

New Features Planned For 5.1
—————————-
Usability enhancements
* Implement `RENAME DATABASE’. To make this safe for all
storage engines, it should work as follows:
* Create the new database.

* For every table do a rename of the table to another
database, as we do with the `RENAME’ command.

* Drop the old database.

…というのがありました。バージョン 5.1 まではなさそうですね。

とのことですので、5.1のドキュメントを見たら、ありました

しかし、5.1が入った環境も少ないかと思いますので、やはりデータをコピーなりダンプなりをして、新しいDBを作成することになるとは思いますが。ユーザー権限の変更もお忘れ無く!

関連する記事:

Powered by

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">