要在MySQL中实现SSH免密码登录,可以按照以下步骤操作:
[mysqld]
bind-address = 0.0.0.0
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
ssh-keygen -t rsa
ssh username@mysql-server-ip-address
mysql -u username -p
如果一切配置正确,您应该能够直接登录到MySQL服务器而无需输入密码。