Home > Database > Mysql Tutorial > body text

How to change storage location in mysql

coldplay.xixi
Release: 2020-10-13 17:50:41
Original
8799 people have browsed it

How to change the storage location of mysql: First create a new 1653mydata folder under [D:\]; then cmd into the dos window, enter net stop mysql to stop the MySQL service, and copy the original file to [D:\ mydata] folder; finally change the datadir value and restart.

How to change storage location in mysql

How to change the storage location of mysql:

1. After the mysql installation is completed, you need to modify the database storage location Location, such as moving from the E:\Program Files (x86)\MySQL\data folder in the installation directory to the D:\mydata folder.

2. Create a new 1653mydata folder under D:\

3. Enter cmd into the dos window, enter net stop mysql to stop the MySQL service, and change C:\ProgramData\MySQL\MySQL Server 5.5\ Copy the folders and files under data (ProgramData is a hidden folder) to the D:\mydata folder

4. Find the my.ini file in the installation directory and find:

#Path to the database root
datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"
Copy after login

Change the value of datadir to datadir="D:/mydata/"

5. After saving, enter cmd into the dos window and enter net start mysql to restart the mySQL service.

More related free learning recommendations: mysql tutorial(Video)

The above is the detailed content of How to change storage location in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template