Did some more digging and testing and i have it working now.
mysql -h 127.0.0.1
does not seem to force tcp/ip, and i had to grant SLAVE MONITOR
to be able to run show slave status.
This doesnt seem to be in accordance with documentation, as BINLOG MONITOR
should work… But i dont want to spend more time on this…
And there were no log messages regarding this (or anything really, as per my previous post), so probably need to increase verbosity to show those errors…
snip:~# mysql -h 127.0.0.1 -u pmm -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13670053
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show slave status\G
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER, SLAVE MONITOR privilege(s) for this operation
MariaDB [(none)]> exit
Bye
snip:~# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13692103
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> GRANT SLAVE MONITOR ON *.* TO 'pmm'@'127.0.0.1';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.008 sec)
MariaDB [(none)]> exit
Bye
snip:~# mysql -h 127.0.0.1 -u pmm -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13713890
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show slave status\G
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER, SLAVE MONITOR privilege(s) for this operation
MariaDB [(none)]> exit
Bye
snip:~# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13716333
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> SHOW GRANTS FOR 'pmm'@'127.0.0.1';
+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for pmm@127.0.0.1 |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, RELOAD, PROCESS, BINLOG MONITOR, SLAVE MONITOR ON *.* TO `pmm`@`127.0.0.1` IDENTIFIED BY PASSWORD '*snip' |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
MariaDB [(none)]> SHOW GRANTS FOR 'pmm'@'localhost';
+----------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for pmm@localhost |
+----------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, RELOAD, PROCESS, BINLOG MONITOR ON *.* TO `pmm`@`localhost` IDENTIFIED BY PASSWORD '*snip' |
+----------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.009 sec)
MariaDB [(none)]> exit
Bye
snip:~# mysql -u pmm -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13766455
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show slave status \G
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER, SLAVE MONITOR privilege(s) for this operation
MariaDB [(none)]> show master status;
Empty set (0.000 sec)
snip:~# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13770715
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> GRANT SLAVE MONITOR ON *.* TO 'pmm'@'localhost';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> SHOW GRANTS FOR 'pmm'@'localhost';
+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for pmm@localhost |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, RELOAD, PROCESS, BINLOG MONITOR, SLAVE MONITOR ON *.* TO `pmm`@`localhost` IDENTIFIED BY PASSWORD '*snip' |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.009 sec)
MariaDB [(none)]> exit
Bye
snip:~# mysql -u pmm -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13778754
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show slave status;
+----------------------------------+---------------+-------------+-------------+---------------+-----------------+---------------------+-------------------------------+---------------+-----------------------+------------------+-------------------+----------------------+-----------------+---------------------+--------------------+--------------------------+-------------------------+-------------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+---------------+----------------+----------------+-----------------------------+------------------+----------------+--------------------+------------+------------------+-------------------------+-----------------------------+---------------+-----------+---------------------+-------------------------+------------------+--------------------------------+----------------------------+
| Slave_IO_State | Master_Host | Master_User | Master_Port | Connect_Retry | Master_Log_File | Read_Master_Log_Pos | Relay_Log_File | Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running | Slave_SQL_Running | Replicate_Rewrite_DB | Replicate_Do_DB | Replicate_Ignore_DB | Replicate_Do_Table | Replicate_Ignore_Table | Replicate_Wild_Do_Table | Replicate_Wild_Ignore_Table | Last_Errno | Last_Error | Skip_Counter | Exec_Master_Log_Pos | Relay_Log_Space | Until_Condition | Until_Log_File | Until_Log_Pos | Master_SSL_Allowed | Master_SSL_CA_File | Master_SSL_CA_Path | Master_SSL_Cert | Master_SSL_Cipher | Master_SSL_Key | Seconds_Behind_Master | Master_SSL_Verify_Server_Cert | Last_IO_Errno | Last_IO_Error | Last_SQL_Errno | Last_SQL_Error | Replicate_Ignore_Server_Ids | Master_Server_Id | Master_SSL_Crl | Master_SSL_Crlpath | Using_Gtid | Gtid_IO_Pos | Replicate_Do_Domain_Ids | Replicate_Ignore_Domain_Ids | Parallel_Mode | SQL_Delay | SQL_Remaining_Delay | Slave_SQL_Running_State | Slave_DDL_Groups | Slave_Non_Transactional_Groups | Slave_Transactional_Groups |
+----------------------------------+---------------+-------------+-------------+---------------+-----------------+---------------------+-------------------------------+---------------+-----------------------+------------------+-------------------+----------------------+-----------------+---------------------+--------------------+--------------------------+-------------------------+-------------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+---------------+----------------+----------------+-----------------------------+------------------+----------------+--------------------+------------+------------------+-------------------------+-----------------------------+---------------+-----------+---------------------+-------------------------+------------------+--------------------------------+----------------------------+
| Waiting for master to send event | x.x.x.x | repl | 3306 | 60 | bin-log.020273 | 698815045 | snip.001294 | 173307857 | bin-log.020198 | Yes | Yes | | | | | snip | | snip | 0 | | 0 | 173307560 | 81234600014 | None | | 0 | No | | | | | | 27151 | No | 0 | | 0 | | | 9 | | | Slave_Pos | 0-9-163171366587 | | | optimistic | 0 | NULL | Updating | 1190783 | 1980454 | 877356317 |
+----------------------------------+---------------+-------------+-------------+---------------+-----------------+---------------------+-------------------------------+---------------+-----------------------+------------------+-------------------+----------------------+-----------------+---------------------+--------------------+--------------------------+-------------------------+-------------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+---------------+----------------+----------------+-----------------------------+------------------+----------------+--------------------+------------+------------------+-------------------------+-----------------------------+---------------+-----------+---------------------+-------------------------+------------------+--------------------------------+----------------------------+
1 row in set (0.000 sec)
MariaDB [(none)]> exit
Bye