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

Practice of using Tinymce rich text to customize toolbar buttons in Vue

Table of contents Install tinymce, tinymce ts, ti...

Detailed explanation of JavaScript's Set data structure

Table of contents 1. What is Set 2. Set Construct...

uni-app implements NFC reading function

This article shares the specific code of uni-app ...

VMware Workstation Installation (Linux Kernel) Kylin Graphic Tutorial

This article shares with you how to install Kylin...

HTML hyperlink a tag_Powernode Java Academy

Anyone who has studied or used HTML should be fam...

Detailed explanation of PHP+nginx service 500 502 error troubleshooting ideas

Overview When a 500 or 502 error occurs during ac...

Detailed explanation of HTML form elements (Part 2)

HTML Input Attributes The value attribute The val...

Summary of several common logs in MySQL

Preface: In the MySQL system, there are many diff...

How to modify the length limit of group_concat in Mysql

In MySQL, there is a function called "group_...

Summary of naming conventions for HTML and CSS

CSS naming rules header: header Content: content/c...

Solve the abnormal error when building vue environment with webpack

Table of contents First, configure package.json T...

Front-end state management (Part 1)

Table of contents 1. What is front-end state mana...

Implementation code of short video (douyin) watermark removal tool

Table of contents 1. Get the first link first 2. ...