Home  >  Article  >  Backend Development  >  About the problem of installing mysql my.cnf on linux

About the problem of installing mysql my.cnf on linux

WBOY
WBOYOriginal
2016-12-01 01:27:591329browse

Environment: centos 6.5 32-bit
When mysql is not installed, my.cnf already exists in the /etc/ directory. What is this and what does it do? (The following is a screenshot of my local Linux)

About the problem of installing mysql my.cnf on linux

After installing mysql, follow the online tutorial to execute the following code on mysql:

<code>cp support-files/my-medium.cnf /etc/my.cnf</code>

Isn’t the operation to overwrite the my.cnf of mysql with the my.cnf in the system? Why is this done? It is a my.cnf prepared by Linux for mysql. If the my.cnf file of mysql is not placed under /etc, where else can it be placed? Does not affect the use of mysql

Reply content:

Environment: centos 6.5 32-bit
When mysql is not installed, my.cnf already exists in the /etc/ directory. What is this and what does it do? (The following is a screenshot of my local Linux)

About the problem of installing mysql my.cnf on linux

After installing mysql, follow the online tutorial to execute the following code on mysql:

<code>cp support-files/my-medium.cnf /etc/my.cnf</code>

Isn’t the operation to overwrite the my.cnf of mysql with the my.cnf in the system? Why is this done? It is a my.cnf prepared by Linux for mysql. If the my.cnf file of mysql is not placed under /etc, where else can it be placed? Does not affect the use of mysql

Did you choose to install the Mysql component when installing Centos?

Remove the mysql database installed by yum

<code>yum remove mysql -y</code>

my.cnf is the configuration file loaded when mysql starts. The path of my.cnf can be configured by cmake when installing mysql./

-DSYSCONFDIR=/etc #my.cnf path

The value of -DSYSCONFDIR=/etc in the configuration can be defined by yourself

Statement:
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