Mysql5.7 my.ini file loading path and data location modification method under windows7

Mysql5.7 my.ini file loading path and data location modification method under windows7

Update: Now you can go to the MySQL official website and install the MySQL installer to unify the management and configuration of the MySQL software, which is also very convenient for migrating data. Enter MySQL Installer and reconfigure MySQL server, and the database storage location will change. It is more stable than the old-fashioned manual migration below (after manual migration, it is easy for the database to fail to start or cannot be shut down normally). For higher versions of MySQL installer, the custom installation path is hidden very deeply during installation. Please refer to https://www.jb51.net/article/82493.htm.

Because I needed to transfer the company's online database to the local computer for testing, I spent a lot of time fiddling with the local MySQL data location. There are a lot of introductions online, so I won't repeat them here. I'll just write down the problems I encountered for your reference.

mysql version: 5.7
OS: Windows 7

(Different MySQL versions may have differences in the installation path data path and the startup configuration file path of my.ini, so we will not study it.)

Change the data location of MySQL, in addition to what is said on the Internet:

(1) Shut down the MySQL service;

(2) Modify the datadir of my.ini (the path is "\" or "/", and the entire path name must be enclosed in double quotes. You can try it yourself and follow the method that works for you. I don't use double quotes, and both forward and backward slashes are fine);

(3) Then migrate the entire data folder (this data folder may be in different folders depending on the version and system, such as c:\Program Files\MySQL or c:\ProgramData\MySQL. It is recommended to use the software "everything" to find it yourself) to the modified directory; (4) Finally, restart.

In addition to these 4 basic steps, you should also pay attention to which startup file my.ini is used by MySQL. This should be based on the information of MySQL in the Windows registry. The specific operation is: Start-Run-regedit-Enter, enter the Windows registry, and then find [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySql] (note that this is the registration path under win7 and MySQL5.7, other versions may be different), and modify the path file after "--defaults-file=" in "ImagePath". This file is the configuration file read when MySQL is started. It is not necessarily the configuration file used if it is placed in the MySQL installation directory or the data directory.

Summarize

The above is what I introduced to you about the loading path and data location modification of the my.ini file in Mysql5.7 under Windows7. 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:
  • Solution to the lack of my.ini file in MySQL 5.7
  • Detailed steps to configure my.ini for mysql5.7 and above

<<:  How to Learn Algorithmic Complexity with JavaScript

>>:  Detailed explanation of ActiveMQ deployment method in Linux environment

Recommend

How to implement two-way binding function in vue.js with pure JS

Table of contents First, let's talk about the...

Example code for implementing the "plus sign" effect with CSS

To achieve the plus sign effect shown below: To a...

Detailed tutorial on installation and configuration of MySql 5.7.17 winx64

1. Download the software 1. Go to the MySQL offic...

How to use nginx as a proxy cache

The purpose of using cache is to reduce the press...

Linux system (Centos6.5 and above) installation jdk tutorial analysis

Article Structure 1. Preparation 2. Install Java ...

How to create an Nginx server with Docker

Operating environment: MAC Docker version: Docker...

Mini Program implements list countdown function

This article example shares the specific code for...

MySQL 5.7.25 installation and configuration method graphic tutorial

There are two types of MySQL installation files, ...

Solution to Linux not supporting all commands

What should I do if Linux does not support all co...

Linux kernel device driver system call notes

/**************************** * System call******...

Detailed explanation of vue page state persistence

Table of contents Code: Replenish: Summarize Requ...

Detailed explanation of Vue filter implementation and application scenarios

1. Brief Introduction Vue.js allows you to define...

Detailed process of installing the docker plugin in IntelliJ IDEA (2018 version)

Table of contents 1. Development Environment 2. I...

Graphic tutorial on installing Ubuntu 18.04 on VMware 15 virtual machine

In the past few years, I have been moving back an...

WeChat Mini Programs are shared globally via uni-app

In actual use, it is often necessary to share the...