Re: Move database to a new machine
Posted by: Frenco LTD
Date: August 30, 2022 04:15AM

1. Backup Database

Backup the database using the following command:

2. Move Database Files

If you have changed any files in the database directory, move them to the new location. If you haven't changed anything, skip this step.

mv /var/lib/mysql/db_name/* /var/lib/new_db_name/

3. Restore Database

Restore the database using the following commands:

4. Change User Password

Change the password for the mysql user using the following command:

UPDATE users SET PASSWORDPASSWORD('password') WHERE USER'root';

5. Restart MySQL Server

Options: ReplyQuote


Subject
Views
Written By
Posted
459
August 21, 2022 04:08PM
Re: Move database to a new machine
242
August 30, 2022 04:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.