Skip to Content
MySQL 8 Cookbook
book

MySQL 8 Cookbook

by Karthik Appigatla
January 2018
Intermediate to advanced
446 pages
12h 57m
English
Packt Publishing
Content preview from MySQL 8 Cookbook

How to do it...

  1. Stop the MySQL server:
 shell> sudo systemctl stop mysql
  1. Move the files to the data directory:
 shell> sudo mv /backup/mysql /var/lib
  1. Change the ownership to mysql:
 shell> sudo chown -R mysql:mysql /var/lib/mysql
  1. Start MySQL:
 shell> sudo systemctl start mysql

To minimize the downtime, if you have enough space on disk, you can copy to the backup to /var/lib/mysql2. Then stop MySQL, rename the directory, and start the server:

shell> sudo mv /backup/mysql /var/lib/mysql2shell> sudo systemctl stop mysqlshell> sudo mv /var/lib/mysql2 /var/lib/mysqlshell> sudo chown -R mysql:mysql /var/lib/mysqlshell> sudo systemctl start mysql
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Cookbook

MySQL Cookbook

Paul DuBois
Advanced MySQL 8

Advanced MySQL 8

Eric Vanier, Birju Shah, Tejaswi Malepati

Publisher Resources

ISBN: 9781788395809Other