The default storage directory of mysql is This article uses MySQL 8.0.20, which is different from MySQL 8.0.11. For data migration of version 8.0.11, please see another blog: mysql8.0.11 data migration 1. Stop the mysql service first: service mysqld stop 2. Create the directory location where you need to store it and grant permissions: mkdir -p /bak/mysql_data chmod 766 /bak/mysql_data 3. Transfer the original data. Use cp -a to copy it (first enter the default directory /var/lib/ and copy the entire mysql directory): cp -a mysql /bak/mysql_data/ 4. Modify the mysql configuration file /etc/my.cnf: vim /etc/my.cnf Original settings: datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid Modified settings: datadir=/bak/mysql_data/mysql socket=/bak/mysql_data/mysql/mysql.sock log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid 5. Restart the mysql service: service mysqld restart mysql can start normally and it's OK~ This article uses MySQL 8.0.20, which is different from MySQL 8.0.11. For data migration of version 8.0.11, please see another blog: mysql8.0.11 data migration This is the end of this article about the method of migrating the data directory of MySQL 8.0.20. For more relevant content about MySQL data directory migration, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: UTF-8 and GB2312 web encoding
>>: A line of CSS code that crashes Chrome
This article shares the download, installation an...
The environment of this article is Windows 10, an...
1. MyISAM storage engine shortcoming: No support ...
Table of contents Docker-Maven-Plugin Maven plugi...
When nginx configures proxy_pass, the difference ...
【Foreword】 Recently I want to stress test ITOO...
What is VNode There is a VNode class in vue.js, w...
Table of contents 1. Register an account on Baidu...
This article shares the specific code for JavaScr...
This article shares with you how to use the Vue s...
question How to modify CSS pseudo-class style wit...
This article describes how to use docker to deplo...
Preface Before, I used cache to highlight the rou...
Configure multiple servers in nginx.conf: When pr...
We can use the scp command of Linux (scp cannot b...