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
Table of contents Mixins implementation Hook func...
This article briefly introduces how to install My...
This article is used to record the installation o...
Download the secure terminal MobaXterm_Personal F...
Install mysql5.7.18 on CentOS6.7 1. Unzip to the ...
Table of contents 1. Dep 2. Understand obverser 3...
Route parameters, route navigation guards: retain...
Using the Vue language and element components, we...
How can you improve web page performance? Most de...
Many friends have asked in forums and message are...
Table of contents Preface No.1 A focus No.2 Extra...
<br />Years of professional art design educa...
XML/HTML CodeCopy content to clipboard < div s...
<br />English address: http://developer.yaho...
Preface The requirement implemented in this artic...