After installing the MySQL database using the rpm installation method, the default path for the data files is /var/lib/mysql. However, the root directory is not suitable for storing data files. Original path: /var/lib/mysql Target path: /home/mysql_data/mysql Linux system version: centos7.6 MySQL database version: 5.7.25 step: 1. Create a target path 2. Shut down MySQL 3. Copy data files 4. Modify the configuration file /etc/my.cnf Change the original paths in datadir and socket to the target paths datadir=/home/mysql_data/mysql socket=/home/mysql_data/mysql/mysql.sock 5. Start MySQL service NOTE: 1. The error is as follows:
solve: Execute the command: Restart again 2. The error is as follows: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' solve: Modify the configuration file my.cnf and add or modify the following configuration: [client] socket = /home/mysql_data/mysql/mysql.sock Summarize The above is what I introduced to you about modifying the MySQL database data file path under Linux. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Vue Basics Introduction: Vuex Installation and Use
>>: Methods and steps for deploying go projects based on Docker images
In the Linux system, there is a kind of file call...
1: Statement order of grouping function 1 SELECT ...
1. Enter the host machine of the docker container...
How to change the MySQL database directory locati...
Solve the problem that the responseText returned ...
1. Introduction to Docker 1.1 Virtualization 1.1....
Difference between HTML and XHTML 1. XHTML elemen...
1. Some tips on classes declared with class in re...
Table of contents Preface: accomplish: Summarize:...
Recommended Docker learning materials: https://ww...
Table of contents What is insert buffer? What are...
I want to make a page using CSS3 rounded corners ...
First of all, what is 404 and soft 404? 404: Simpl...
1. What is Docker? (1) Docker is an open source t...
Set the background image for the table header. Yo...