Home >Database >Mysql Tutorial >How to change storage location in mysql
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 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/"
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!