The default storage directory of mysql is This article uses MySQL 8.0.11, which is different from MySQL 8.0.20. For data migration of version 8.0.20, please see another blog: mysql8.0.20 data migration 1. Stop the mysql service first: service mysql 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 /usr/local/ 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: [client] port=3306 socket=/tmp/mysql.sock [mysqld] port=3306 user=mysql socket=/tmp/mysql.sock basedir=/usr/local/mysql/mysql8.0 datadir=/usr/local/mysql/mysql8.0/data lc-messages-dir = /usr/local/mysql/mysql8.0/share character-set-server=utf8 Modified settings: [client] port=3306 socket=/tmp/mysql.sock [mysqld] port=3306 user=root socket=/tmp/mysql.sock basedir=/usr/local/mysql/mysql8.0 datadir=/bak/mysql_data/mysql/mysql8.0/data lc-messages-dir = /usr/local/mysql/mysql8.0/share character-set-server=utf8 This involves a permission issue, and the user needs to be changed to root 5. Restart the mysql service: service mysql restart mysql can start normally and it's OK~ If the problem "The server quit without updating PID file(…)" appears during startup, please refer to another blog: This article uses MySQL 8.0.11, which is different from MySQL 8.0.20. For data migration of version 8.0.20, please see another blog: mysql8.0.20 data migration This is the end of this article about the implementation of MySQL 8.0.11 data directory migration. For more relevant MySQL data directory migration content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Three useful codes to make visitors remember your website
>>: CSS: visited pseudo-class selector secret memories
I would like to share with you the graphic tutori...
1. Overview MySQL version: 5.6.21 Download addres...
To put it simply, the IP of the virtual machine u...
This article will introduce a very interesting at...
Here we only focus on the installation and use of...
My machine environment: Windows 2008 R2 MySQL 5.6...
<div id="root"> <h2>Keep go...
How Nginx works Nginx consists of a core and modu...
You can have the best visual design skills in the...
ERROR 1290 (HY000) : The MySQL server is running ...
This article shares the specific code of JS to im...
1: If you use the tag <a> to link to a page,...
Table of contents 1. Middleman Model 2. Examples ...
Port Mapping Before the Docker container is start...
This article describes how to add or expand a dis...