Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql View profile my.cnf handout

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly gives you a brief talk about mysql view configuration file my.cnf handouts, related technical terms you can check online or find some related books to supplement, here will not dabble, go straight to the topic, hope to bring you some practical help.

my.cnf is a configuration file loaded when mysql starts. It is generally placed in the mysql installation directory, and users can also load it in other directories.

After mysql is installed, there will be multiple my.cnf files in the system, some for testing.

Use the locate my.cnf command to list all my.cnf files

Command locate my.cnf Output/usr/local/Cellar/mysql/5.6.24/my.cnf/usr/local/Cellar/mysql/5.6.24/mysql-test/include/default_my.cnf/usr/local/Cellar/The requested URL/mysql/5.6.24/mysql-test/suite/federated/my.cnf/usr/local/Cellar/mysql/5.6.24/mysql/suite/ndb/my.cnf/usr/local/was not found on this server. Cellar/mysql/5.6.24/mysql-test/suite/ndb_big/my.cnf/usr/local/Cellar/mysql/5.6.24/mysql-test/suite/ndb_binlog/my.cnf/usr/local/Cellar/mysql/5.6.24/mysql-test/suite/ndb_rpl/my.cnf/usr/local/Cellar/mysql/5.6.24/mysql-test/suite/ndb_team/my.cnf/usr/local/Cellar/mysql/5.6.24/mysql-test/suite/rpl/extension/bhs/my.cnf/usr/local/Cellar/mysql/5.6.24/mysql-test/suite/rpl/my.cnf/usr/local/Cellar/mysql/5.6.24/mysql-test/suite/rpl_ndb/my.cnf

When we need to modify the configuration file, we need to find out which my.cnf file was loaded when mysql started.

1. Check if my.cnf of the specified directory is used

After starting mysql, we check the mysql process to see if there is a my.cnf file set to use the specified directory, and if there is, it means that mysql is loaded with this configuration file when it starts.

Command ps aux| grep mysql| grep 'my.cnf' output fdipzone 25174 0.0 0.0 3087244 600 ?? S 4:12 PM 0:01.14 /usr/local/Cellar/mysql/5.6.24/bin/mysqld --defaults-file=/usr/local/Cellar/mysql/5.6.24/my.cnf --basedir=/usr/local/Cellar/mysql/5.6.24 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.6.24/lib/plugin --bind-address=127.0.0.1 --log-error=/usr/local/var/mysql/TerrydeMacBook-Air.local.err --pid-file=/usr/local/var/mysql/TerrydeMacBook-Air.local.pidfdipzone 25064 0.0 0.0 2452824 4 ?? S 4:12 PM 0:00.03 /bin/sh /usr/local/opt/mysql/bin/mysqld_safe --defaults-file=/usr/local/Cellar/mysql/5.6.24/my.cnf --bind-address=127.0.0.1 --datadir=/usr/local/var/mysql

You can see that/usr/local/Cellar/mysql/5.6.24/my.cnf is the configuration file loaded by mysql startup.

If there is no output from the above command, my.cnf is not set to use the specified directory.

2. Check the directory where mysql reads my.cnf by default

If my.cnf is not set to use the specified directory, mysql starts by reading my.cnf files in the root directory of the installation directory and in the default directory.

View the default directory where mysql reads configuration files at startup

command mysql --help| grep 'my.cnf' output order of preference, my.cnf, $MYSQL_TCP_PORT,/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf

/etc/my.cnf, /etc/mysql/my.cnf, /usr/local/etc/my.cnf, ~/my.cnf These are the directories mysql searches for my.cnf by default, first in order.

3. No profile used at startup

If the my.cnf file is not set to use the specified directory and the default reading directory does not have the my.cnf file, it means that mysql does not load the configuration file when it starts, but uses the default configuration.

If you need to modify the configuration, you can create a my.cnf file (for example:/etc/my.cnf) in the directory that mysql reads by default, write the configuration content that needs to be modified, and restart mysql to take effect.

This article introduces how mysql views the currently used configuration file my.cnf. For more information, please pay attention.

Related recommendations:

How to determine whether a point is within a specified polygon area by mysql

How to call php imagemagick to achieve the old photo effect

How to calculate Cartesian product of multiple sets

mysql view configuration file my.cnf handout will first tell you here, for other related issues you want to know can continue to pay attention to industry information. Our section content captures some industry news and expertise to share with you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report