如何解决MySQL在高版本需要指明是否进行SSL连接问题

如何解决MySQL在高版本需要指明是否进行SSL连接问题,第1张

 Java使用mysql-jdbc连接MySQL出现如下警告:Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.在mysql连接字符串url中加入ssl=true或者false即可,如下所示。url=jdbc:mysql://127.0.0.1:3306/framework?characterEncoding=utf8&useSSL=true

就是使用JDBC跟你的数据库连接的时候,你的JDBC版本与MySQL版本不兼容,MySQL的版本更高一些,在连接语句后加上“useSSL=‘true’” ,就可以连接到数据库了。更高版本。

意思是设置单行显示。

1.如果和layout_width一起使用,当文本不能全部显示时,后面用“…”来表示。如 android:text="test_ singleLine " android:singleLine="true" android:layout_width="20dp"

将只显示“t…”。

2.如果不设置singleLine或者设置为false,文本将自动换行

mysql workbench版本是8.0.27,建立连接的时候连接报错

解决方案有如下2个,1个是降版本,使用低版本的workbench。

另一个是切换到Advaced标签页,在Others文本框中添加 useSSL=0 ,即可成功连接。

参考链接

https://blog.csdn.net/hongweigg/article/details/122069772

https://stackoverflow.com/questions/69824631/mysql-workbench-ssl-connection-error-ssl-is-required-but-the-server-doesnt-sup


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/8731058.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-20
下一篇 2023-04-20

发表评论

登录后才能评论

评论列表(0条)

保存