Forum Stats

  • 3,837,684 Users
  • 2,262,285 Discussions
  • 7,900,359 Comments

Discussions

Rename Mysql Instance

3210603
3210603 Member Posts: 2
edited Mar 28, 2018 2:53AM in MySQL Community Space

Hello everybody ..

I need to rename an instance Mysql.(5.5.28)

I can't use mysqldump : too long because my database = 2 terrabytes.

I would like to know if there is any method like NID in Oracle to rename an instance.

I think not ...

So I think modify the files :  my.cnf,  name_instance.cnf and the directories concerned but I am not sure it is enough : what happens after inside the instance : no other change ?

If anyone have any idea : I take it !

Thanks a lot.

Patrick

Answers

  • Dave Stokes-MySQL Community Team-Oracle
    Dave Stokes-MySQL Community Team-Oracle MySQL Community Manager TexasMember Posts: 374 Employee
    edited Mar 26, 2018 6:46AM

    First, MySQL 5.5 is VERY OLD and you need to UPDATE.  The RENAME DATABASE command is found in MySQL 5.6 and 5.7. (And MySQL 8 will be out in the near future)

    If you are stuck on 5.5 you can create an new schema and then copy tables over as 5.5 has no RENAME DATABASE command. 

    Dave Stokes

    MySQL Community Manager

  • 3210603
    3210603 Member Posts: 2
    edited Mar 28, 2018 2:53AM

    Hello Dave

    Thank you for your reply.

    I am sorry but my client wants to update AFTER the opération .. not before .. Unfortunatelay the customer decides...

    Besides I don't want to rename a database but an INSTANCE.

    So, I have modified my.cnf,  name_instance.cnf and the directories and my sql restarted correctly with the new name.

    Bye

    Patrick