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

Resolve invalid mysqld_multi stop command

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

Share

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

After building the mysql multi-instance environment, you want to stop MySQL service through mysqld_multi stop, but executing this command is invalid, mysql still runs normally

For mysql multi-instance environment deployment, please refer to MySQL multi-instance environment deployment blog post

The log error is as follows:

Stopping MySQL servers

mysqladmin: connect to server at 'localhost' failed

error: 'Access denied for user 'root'@'localhost' (using password: NO)'

mysqld_multi log file version 2.16; run: Thu Jun 28 14:47:48 2018

Cause analysis:

By looking at the error message above, you can see that it must be a problem that mysqladmin cannot log in

Solution:

The reason is that user and pass are not configured in the my.cnf file. After adding them, it will be fine.

The my.cnf configuration file reads as follows

[mysqld_multi]

user=root

pass=XXXXX //Note that pass is not password

mysqld=/usr/local/mysql/bin/mysqld_safe

mysqladmin=/usr/local/mysql/bin/mysqladmin

log=/data/mysql/mysqld_multi.log

[mysqld]

#skip-grant-tables

user=mysql

basedir = /usr/local/mysql

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysqld3306]

mysqld=mysqld

mysqladmin=mysqladmin

datadir=/data/mysql/mysql_3306/data/

socket=/tmp/mysql3306.sock

port=3306

server_id=3306

log-output=file

slow_query_log = 1

long_query_time = 1

slow_query_log_file = /data/mysql/mysql_3306/log/slow.log

log-error = /data/mysql/mysql_3306/log/error.log

binlog_format = mixed

log-bin = /data/mysql/mysql_3306/log/mysql3306.bin

For more information about mysql, please refer to the author's blog:

http://blog.itpub.net/31015730/cid-184172-list-1/

Author: SEian.G (practice seventy-two changes, laugh at eighty-one difficulties)

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