Solution to the problem that the MySQL configuration file cannot be modified (Win10)

Solution to the problem that the MySQL configuration file cannot be modified (Win10)

Record the problems you solve for others.

Problem Description

The version of MySQL is 5.7 and the operating system is window10. MySQL is installed in C:\Program Files. Recently, you need to add a new configuration item to the my-default.ini configuration file in the MySQL installation directory:

max_allowed_packet=100M

After editing a file, I always fail to save it and get the message "Access Denied".
Later, I stopped the MySQL service, but still could not save the changes.
Then copy my-default.ini to drive D, modify it and save it. Delete the original configuration file under C:\Program Files. Open a command line as an administrator and use the copy command to copy the files to the original location under C:\Program Files. Although the problem of the configuration file not being able to be saved was solved, after restarting the MySQL service, the show variables command showed that the parameters had not been changed.

Workaround

1. Stop the MySQL service.

2. Open the file browser. File -> Change folder and search options -> "View" tab -> uncheck all hidden files and folders.

3. You can now see the hidden folder C:\ProgramData\MySQL\MySQL Server 5.7. In this folder there is a my.ini configuration file. MySQL reads this configuration file by default.

4. Copy myini to another disk, such as drive D.

5. Modify D:\my.ini and save. Note: max_allowed_packet=100M should be placed under the [mysqld] configuration section. You can search for this parameter first. If the system already has it, just change the number.

6. Delete my.ini in the original installation directory as an administrator.

7. Open the Start menu, right-click on the command line menu item -> Run as administrator. Execute the command:

copy "D:\my.ini" "C:\ProgramData\MySQL\MySQL Server 5.7"

Seventh, start the MySQL service.

think

Win10 restricts files and folders to be modified only with administrator privileges. So use this command line to solve the problem. At the same time, MySQL reads the my.ini configuration file under C:\ProgramData\MySQL\MySQL Server 5.7 by default.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • MySQL configuration file my.cnf parameter optimization and Chinese detailed explanation
  • Detailed explanation of MySQL my.ini configuration file
  • MySQL performance optimization road --- modify the configuration file my.cnf
  • Detailed explanation of MySQL configuration file my.cnf in Chinese, with sharing of MySQL performance optimization methods
  • MySQL optimization configuration file my.ini (discuz forum)
  • MariaDB (MySQL branch) my.cnf configuration file Chinese annotated version
  • Detailed explanation of MySQL configuration file my.cnf optimization (mysql5.5)
  • MySQL 5.5.49 large memory optimization configuration file optimization details
  • MySQL 5.6 & 5.7 Optimal Configuration File Template (my.ini)
  • Comparison of the Chinese version of the MySQL configuration file my.cnf

<<:  jQuery implements clicking left and right buttons to switch pictures

>>:  Detailed explanation of Tomcat's Server Options

Recommend

What you need to know about MySQL auto-increment ID

Introduction: When using MySQL to create a table,...

WeChat applet custom tabBar step record

Table of contents 1. Introduction 2. Customize ta...

How to modify iTunes backup path under Windows

0. Preparation: • Close iTunes • Kill the service...

How to open a page in an iframe

Solution: Just set the link's target attribute...

Detailed explanation of 6 ways of js inheritance

Prototype chain inheritance Prototype inheritance...

Upgrade MySQL 5.1 to 5.5.36 in CentOS

This article records the process of upgrading MyS...

Web front-end performance optimization

Web front-end optimization best practices: conten...

How to install Windows Server 2008 R2 on Dell R720 server

Note: All pictures in this article are collected ...

Difference between src and href attributes

There is a difference between src and href, and t...

Native JS to achieve drag photo wall

This article shares with you a draggable photo wa...

Mysql Chinese sorting rules description

When using MySQL, we often sort and query a field...

JavaScript Dom implements the principle and example of carousel

If we want to make a carousel, we must first unde...

Importance of background color declaration when writing styles

As the title says, otherwise when the page is revi...