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

Summary of HTML knowledge points for the front end (recommended)

1. HTML Overview htyper text markup language Hype...

Detailed Example of Row-Level Locking in MySQL

Preface Locks are synchronization mechanisms used...

Innodb system table space maintenance method

Environmental Description: There is a running MyS...

Linux bash: ./xxx: Unable to execute binary file error

Today I sent a small tool for Ubuntu to a custome...

Linux system MySQL8.0.19 quick installation and configuration tutorial diagram

Table of contents 1. Environment Introduction 2. ...

A brief discussion on tags in HTML

0. What is a tag? XML/HTML CodeCopy content to cl...

About vue component switching, dynamic components, component caching

Table of contents 1. Component switching method M...

Solution to Nginx SSL certificate configuration error

1. Introduction When a web project is published o...

mysql indexof function usage instructions

As shown below: LOCATE(substr,str) Returns the fi...

Detailed explanation of common for loop in JavaScript statements

There are many loop statements in JavaScript, inc...

Bootstrap 3.0 learning notes button style

This article mainly explains the style of buttons...

Detailed explanation of the use of DockerHub image repository

Previously, the images we used were all pulled fr...

A brief discussion on the use and analysis of nofollow tags

Controversy over nofollow There was a dispute bet...

HTML Several Special Dividing Line Effects

1. Basic lines 2. Special effects (the effects ar...