I am trying to run pt-sho-grants 3.5.7 and it is not running
here is what I am getting
pt-show-grants --socket=/home/mysqladm/tmp/mysql.sock --user=mysqluser --password=‘**************’ --host=rn000064020
DBI connect(‘;host=298;mysql_socket=/home/mysqladm/tmp/mysql.sock;mysql_read_default_group=client’,‘myusername’,…) failed: Can’t connect to MySQL server on ‘298’ (22) at /usr/bin/pt-show-grants line 1367.
I am running against mysql 8.0.36-28.1
any thoughts ?
Hi @stanlip,
Even have you specified in your command, it somehow sees the host 298. Have you check your /etc/hosts is there any wrong record for this host rn000064020, or did you try with the IP address?
DBIconnect(‘;host=298;mysql_socket=/home/mysqladm/tmp/mysql.sock;mysql_read_default_group=client’,‘myusername’,…) failed: Can’t connect to MySQL server on ‘298’ (22) at /usr/bin/pt-show-grants line 1367.
Could you please share the user details? You can mask them for sure.
SELECT * FROM mysql.user where user='mysqluser'\G
Host: localhost
User: myuser
Select_priv: Y
Insert_priv: Y
Update_priv: Y
Delete_priv: Y
Create_priv: Y
Drop_priv: Y
Reload_priv: Y
Shutdown_priv: Y
Process_priv: Y
File_priv: Y
Grant_priv: Y
References_priv: Y
Index_priv: Y
Alter_priv: Y
Show_db_priv: Y
Super_priv: Y
Create_tmp_table_priv: Y
Lock_tables_priv: Y
Execute_priv: Y
Repl_slave_priv: Y
Repl_client_priv: Y
Create_view_priv: Y
Show_view_priv: Y
Create_routine_priv: Y
Alter_routine_priv: Y
Create_user_priv: Y
Event_priv: Y
Trigger_priv: Y
Create_tablespace_priv: Y
ssl_type:
ssl_cipher: 0x
x509_issuer: 0x
x509_subject: 0x
max_questions: 0
max_updates: 0
max_connections: 0
max_user_connections: 0
plugin: mysql_native_password
authentication_string: *******************************************
password_expired: N
password_last_changed: 2025-04-16 09:48:17
password_lifetime: NULL
account_locked: N
Create_role_priv: Y
Drop_role_priv: Y
Password_reuse_history: NULL
Password_reuse_time: NULL
Password_require_current: NULL
User_attributes: NULL
The user host part is saying localhost, so you should only be able to connect to MySQL on localhost. You can try changing your-- host option and running Percona Toolkit from the MySQL node.
Host: localhost
Thank You but that also did not work What did work was putting the userid and password in the
[client] section in the my.cnf file. I don’t like that option because of the cleartext password in my.cnf.
I put the info into the my.cnf and removed it after I was done