How to modify the MySQL data directory under Windows
How to modify the MySQL data directory under Windows: First stop the MySQL service and create a new data file directory; then copy the data file and authorize the new data file directory; then modify the [my.ini] file ;Finally start MySQL.
How to modify the MySQL data directory under Windows:
Stop the MySQL service:
MySQL service in windows services, stop.
Create a new data file directory:
This is the MySQL data directory you want to store now, for example: E:\MySQL5.6Data
Copy data files:
Copy the "data files and subdirectories" in the original data directory to the E:\MySQL5.6Data directory just created; pay attention to your original data files Do not copy the wrong directory and data files. If you have not modified the original directory much, the original directory should look like "..\ProgramData\MySQL\...\data\". Copy the contents of the data directory to in a new directory.
New data file directory authorization
This step is very important. Many students cannot start MySQL because of this, and only have 1067 errors.
Right-click the new directory E:\MySQL5.6Data, select the "Security" tab, and grant full control permissions to all the following users and groups (Note: You can do this on the test machine, if it is a production environment , you need to try one by one until the 1067 error is not reported).
Modify the my.ini file
Many articles on the Internet say that my.ini is in the MySQL installation directory. Many people may find that my.ini does not exist in that location. File, there is only one my-default.ini file, this file is basically useless.
Non-installation version of MySQL: the my.ini configuration file may be in this directory;
Installation version of MySQL: Most of the my.ini files are in your In the data file directory, if it is not there, you can right-click the MySQL service in the Windows service list, select Properties, and you can see the executable file path in the "General" tab, followed by a --defaultFile parameter. After this parameter The value is the path to your my.ini file.
After finding the my.ini file, open it and modify the value of datadir to a new directory, such as E:\MySQL5.6Data; in most cases, just modify this place, but in order to ensure some "mutation" , you can check whether the change needs to be completed by searching for the original data path keywords (such as the original drive letter).
Save after modification. If you are installing the MySQL version and the my.ini file is in the original data file directory, you still need to do two things:
1. Copy the my.ini file to the MySQL installation directory or the new data file directory;
2. Open "Run" in windows r, enter regedit and press Enter to open the registry, HKEY_LOCAL_MACHINE-->SYSTEM--> ;CurrentControlSet-->Find the MySQL service key under services, and then modify its ImagePath attribute value to the new absolute path of the my.ini file.
Start MySQL
In the MySQL service list, start MySQL.
More related free learning recommendations: mysql tutorial(Video)
The above is the detailed content of How to modify the MySQL data directory under Windows. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Solve the problem of third-party interface returning 403 in Node.js environment. When we use Node.js to call third-party interfaces, we sometimes encounter an error of 403 from the interface returning 403...

The problem of comparing and synchronizing BeyondCompare files: Case sensitivity failure when using Beyond...

How to avoid the third-party interface returning 403 error in the Node environment. When calling the third-party website interface using Node.js, you sometimes encounter the problem of returning 403 error. �...

Multithreading in the language can greatly improve program efficiency. There are four main ways to implement multithreading in C language: Create independent processes: Create multiple independently running processes, each process has its own memory space. Pseudo-multithreading: Create multiple execution streams in a process that share the same memory space and execute alternately. Multi-threaded library: Use multi-threaded libraries such as pthreads to create and manage threads, providing rich thread operation functions. Coroutine: A lightweight multi-threaded implementation that divides tasks into small subtasks and executes them in turn.

Why can't my code get the data returned by the API? In programming, we often encounter the problem of returning null values when API calls, which is not only confusing...

Python binary library (.whl) download method explores the difficulties many Python developers encounter when installing certain libraries on Windows systems. A common solution...

Mastering Debian system log monitoring is the key to efficient operation and maintenance. It can help you understand the system's operating conditions in a timely manner, quickly locate faults, and optimize system performance. This article will introduce several commonly used monitoring methods and tools. Monitoring system resources with the sysstat toolkit The sysstat toolkit provides a series of powerful command line tools for collecting, analyzing and reporting various system resource metrics, including CPU load, memory usage, disk I/O, network throughput, etc. The main tools include: sar: a comprehensive system resource statistics tool, covering CPU, memory, disk, network, etc. iostat: disk and CPU statistics. mpstat: Statistics of multi-core CPUs. pidsta

Multithreading is an important technology in computer programming and is used to improve program execution efficiency. In the C language, there are many ways to implement multithreading, including thread libraries, POSIX threads, and Windows API.
