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 specifies what the configuration file loaded by / etc/init.d/mysql looks like

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you what the configuration file specified by Mysql / etc/init.d/mysql loads is like, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Background: online mysql databases are started in the following ways

/ home/data/mysql/bin/mysqld_safe-defaults-file=/home/data/mydata/3308/my.cnf &

Now that you want to add the startup script of mysql under / etc/init.d for easy management, you have to do the following

Copy the startup script from the startup directory to / etc/init.d

Cp / home/data/mysql/support-files/mysql.server / etc/init.d/mysql

Modify / etc/init.d/mysql

Basedir=/home/data/mysql

Datadir=/home/data/mydata/3308

# Try to find basedir in / etc/my.cnf

Conf=/home/data/mysql/my.cnf-the loaded configuration file will be called / etc/my.cnf first by default. / home/data/mysql/my.cnf will be called (under the mysqlbasedir directory)

Note: if the configuration file is not under / etc/ or basedir, the configuration file specified by conf for another path does not take effect. I don't know why.

Test:

[root@host-192-168-1-56 init.d] # / etc/init.d/mysql start

Starting MySQL... SUCCESS!

[root@host-192-168-1-56 init.d] # / etc/init.d/mysql status

SUCCESS! MySQL running (48764)

[root@host-192-168-1-56 init.d] # / etc/init.d/mysql stop

Shutting down MySQL.. SUCCESS!

Note: the conf configuration file of the startup file is either specified under / etc/ or basedir, and no other path is allowed!

The above is what the configuration file specified by Mysql / etc/init.d/mysql is like. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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