-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
failed to execute: SHOW SLAVE HOSTS #553
Comments
[!!] failed to execute: SHOW REPLICA STATUS\G |
Still the same error for me as well. |
Running the following bash script I get a return code of zero. Not sure why mysqltuner.pl still reports error 256.
Prints
This is testing for the wrong version with
I've tested the above code and it works on my version of mariaDB. If you would like me to submit a pull request I can do that. Since I don't actually have any slaves attached, probably someone else should test first. |
Just wondering if we'll see this in the version hosted on github used by everyone... any update on that? (He asks as he sees the error just now ... although I'm running MySQL version 5.7.33-0ubuntu0.16.04.1. |
Reference Issue major#553 Reversing the check for version of mysql or mariadb to use correct command.
For MySQL 8.0 the patch doesn't work. The problem is that unlike MariaDB 10.5 mysql> SELECT VERSION();
+-------------------------+
| VERSION() |
+-------------------------+
| 8.0.25-0ubuntu0.20.04.1 |
+-------------------------+
1 row in set (0.00 sec)
mysql> show replica status\G
*************************** 1. row ***************************
Replica_IO_State: Waiting for master to send event
Source_Host: 10.243.0.47
Source_User: replication
Source_Port: 3306
Connect_Retry: 60
Source_Log_File: mysql-bin.002049
Read_Source_Log_Pos: 96712410
Relay_Log_File: mysqld-relay-bin.000365
Relay_Log_Pos: 67138716
Relay_Source_Log_File: mysql-bin.002049
Replica_IO_Running: Yes
Replica_SQL_Running: Yes
... This breaks code like: my ($io_running) = $myrepl{'Slave_IO_Running'}; Other issue is this: @mysqlslaves = select_array "SHOW SLAVE STATUS"; For MySQL 8.0 this should be: @mysqlslaves = select_array "SHOW REPLICAS"; Also the output slightly changes: mysql> SHOW REPLICAS;
+-----------+------+------+-----------+--------------------------------------+
| Server_Id | Host | Port | Source_Id | Replica_UUID |
+-----------+------+------+-----------+--------------------------------------+
| 163 | | 3306 | 164 | 1653d138-fc33-11eb-9c69-023c4b151ba4 |
+-----------+------+------+-----------+--------------------------------------+ |
With newer versions of mariadb I think that instead of the
SHOW SLAVE HOSTS
statement mysqltuner should be using theSHOW REPLICA STATUS;
statement.That way you only need to give mysqltuner permission for
GRANT SELECT, PROCESS, EXECUTE, REPLICA MONITOR, SHOW DATABASES, SHOW VIEW ON *.* TO 'mysqltuner'@'localhost'
The
REPLICA MONITOR
permission would be better than giving theREPLICATION MASTER ADMIN
permission that is required to runSHOW SLAVE HOSTS
The text was updated successfully, but these errors were encountered: