Why is RENAME DATABASE dangerous?

Asked 1 years ago, Updated 1 years ago, 38 views

Found this keyter while renaming the database.

Enable "RENAME DATABASE" without dumping in MySQL

At the beginning of the article, it says, "The phantom command whose existence has been erased because of its over-dangerous function." Why is this command dangerous?

If RENAME DATABASE is dangerous, I understand that both "how to export data from a database and import it into a new database" and "how to use RENAME TABLE" in this article are dangerous, but what are the risks?
I don't understand why only RENAME DATABASE was deleted because it was dangerous even though RENAME TABLE was left.

I looked it up for a while, but I couldn't find a website that said why it was dangerous, so I would appreciate it if you could let me know.

Thank you for your cooperation.

mysql sql

2022-09-30 17:55

1 Answers

It's not an answer, it's a guess.

https://dev.mysql.com/doc/The older version of the document seems to have been deleted, and the rename database search doesn't work.

I searched the archive for the old documentation and found it
http://web.archive.org/web/20160504181056/https://dev.mysql.com/doc/refman/5.1/en/rename-database.html
(hereinafter referred to as Ore Translation)

However, it was deleted because the contents of the database could be lost due to the use of this statement.

and so on.Somehow, I can only read as if there was a specification flaw in the rename database or a bug in the software implementation.So, "Don't use it." "I deleted it."

So, I think it means that you should use it because you have written another safe way without any defects.So rename table is safe.

# When I searched that the old MySQL source must have been stored in our house, it was 5.1.51.Too bad.

According to @metropolis's comment link, it's because there are multiple bugs in the "a couple of bugs".Also, rename database was originally designed to migrate data from MySQL 5.0 to 5.1, so it was deleted. (As of 2007, when 5.1 became the mainstream, it was no longer necessary.)


2022-09-30 17:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.