项目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