What should I do if Linux cannot find my.cnf?

WBOY
Release: 2022-08-11 16:39:54
Original
6421 people have browsed it

Solution: 1. Copy the "my-medium.cnf" file in the "/usr/share/mysql" directory to the "/etc" directory; 2. Rename the copied file to "my .cnf" is enough. The reason why "my.cnf" cannot be found is that MySQL installed using the rpm package will not install the "/etc/my.cnf" file.

What should I do if Linux cannot find my.cnf?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What should I do if Linux cannot find my.cnf

When I want to set mysql to be case-insensitive, I find that the /etc/my.cnf configuration file cannot be found.

1. Solution: Just copy the my-medium.cnf file in the /usr/share/mysql directory to the /etc directory,

What should I do if Linux cannot find my.cnf?

2. Rename the copied file to "my.cnf"

The reason is:

Use rpm package The installed MySQL will not install the /etc/my.cnf file.

As for why MySQL can start normally without this file, there are two opinions:

First In other words, my.cnf is just a parameter file when MySQL is started. It does not need to be used. In this case, MySQL will start with the built-in default parameters.

The second statement is that MySQL automatically uses the my-medium.cnf file in the /usr/share/mysql directory when it starts. This statement is limited to MySQL installed in the rpm package.

Extended knowledge

Installing MySQL through rpm will not install the /etc/my.cnf file, so when configuring master-slave replication, I don’t know how to configure it

When specifically starting mysql, this file is just one of its built-in startup parameters

Even if you can't find it and want to configure this file, you can search it in the file path and make a copy. Specifically in /usr/share/mysql/my-medium.cnf

, also through cp /usr/share/mysql/my-medium.cnf /etc/my. cnf

If you don’t even have this file, you can search directly in the root directory

Recommended learning: Linux video tutorial

The above is the detailed content of What should I do if Linux cannot find my.cnf?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!