How can I change case of database name in MySQL?

前端 未结 6 997
迷失自我
迷失自我 2021-02-04 03:12

My Database name is SPM and I want to change it to spm (small letters).

I tried using

RENAME DATABASE SPM TO spm;
6条回答
  •  忘了有多久
    2021-02-04 03:56

    Use mysql_dump to dump out the database contents of the old schema (it produces SQL output, and can include all the object CREATE statements), switch to the new schema, and execute that script mysql> . dump.sql

    If it's a large database, this may take a while, but it's the safest way to do it (make sure you suspend any applications using the database while the conversion process is going on).

    Delete the old schema when you're satisfied that everything worked.

提交回复
热议问题