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
After docker run, the status is always Exited Sol...
<br />Previously, we learned how to set cell...
Table of contents Function Introduction Rendering...
1. Overview Users expect the web applications the...
This article shares the specific code of JavaScri...
Today, let’s talk about how to start four MySQL d...
Table of contents Actual combat process Let's...
When I used g++ to compile the cpp file for the f...
The enctype attribute of the FORM element specifie...
Data URI Data URI is a scheme defined by RFC 2397...
Inserting Data insert into table name (column nam...
Table of contents What is insert buffer? What are...
Preface Readers who are familiar with MySQL may f...
Preface Everyone knows that many sites now charge...
Use JavaScript to implement a web page clock. The...