項目mysql服務器開啓了ssl連接,如果通過命令行直接-uroot -p是不能連接的。
報錯如下:
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2061 (HY000): Authentication plugin 'sha256_password' reported error: Authentication requires SSL encryption
解決方法:
只需要添加參數--ssl-mode=required
即可,完整命令行連接如下:
$ mysql -uroot -proot --ssl-mode=required