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

Ubuntu starts the SSH service remote login operation

ssh-secure shell, provides secure remote login. W...

Mariadb remote login configuration and problem solving

Preface: The installation process will not be des...

Briefly describe mysql monitoring group replication

Original text: https://dev.mysql.com/doc/refman/8...

Do you know how to use Vue to take screenshots of web pages?

Table of contents 1. Install html2Canvas 2. Intro...

jQuery achieves full screen scrolling effect

This article example shares the specific code of ...

How to reduce image size using Docker multi-stage build

This article describes how to use Docker's mu...

Solve the problem that Docker must use sudo operations

The steps are as follows 1. Create a docker group...

Installation and use of Apache stress testing tools

1. Download Go to the Apache official website htt...

Detailed explanation of the use of JavaScript functions

Table of contents 1. Declare a function 2. Callin...

WeChat applet implementation anchor positioning function example

Preface In the development of small programs, we ...

Solution to Mysql binlog log file being too large

Table of contents 1. Related binlog configuration...