Settings and activity
3 results found
-
79 votes
An error occurred while saving the comment -
230 votes
An error occurred while saving the comment gr8kodr commented[QUOTE] From the MySQL Manual
RENAME DATABASE Syntax
RENAME {DATABASE | SCHEMA} <db_name> TO <new_db_name>;This statement was added in MySQL 5.1.7 but was found to be dangerous and was removed in MySQL 5.1.23. It was intended to enable upgrading pre-5.1 databases to use the encoding implemented in 5.1 for mapping database names to database directory names. However, use of this statement could result in loss of database contents, which is why it was removed. Do not use RENAME DATABASE in earlier versions in which it is present.
To perform the task of upgrading database names with the new encoding, use ALTER DATABASE <db_name> UPGRADE DATA DIRECTORY NAME instead
[END QUOTE]In a round about manner, I was able to perform a Database rename (outlined below) within the IDE. However, for a large database with many tables, I can see that my technique is far from optimal ...
1. Create new DB -> `database1`
2. Add a couple of dummy tables (tbl1, tbl2)
3. Create a new DB `database2`
4. Duplicate the tables from database1 into database2 (individually)
5. DROP `database1`I believe that PhpMyAdmin uses the recipe above to perform the same task with the modification that it allows you move all tables to into the new DB by selecting each table behind the scenes
-
3 votesgr8kodr shared this idea ·
Drag and Drop across connections would seem dangerous to me, if one connection drops out there would be a high risk of data corruption or loss
Surely in this instance the "old" way of exporting to file and importing to new connection would be safer?
Also, I can't see how D&D between SQL versions on the same machine would be safe either ... surely that would make it too simple to retain obsolete schema structures and possibly "break" the new DB without being able to (easily) distinguish what causes the breakage