Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
917 views
in Technique[技术] by (71.8m points)

how does one rename a schema in MySQL

Hi I am using mysql 5.0.x

How do I rename a schema?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Don't use RENAME DATABASE!!!

Early 5.1 versions had this command but it's been removed since it can corrupt data (reference).

The only way at present is

mysqladmin create new_db_name
mysqldump db_name | mysql new_db_name

as referred to here

Edit: Obviously this answer will become dated once this gets fixed.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...