关于mysql8.0的url链接问题

8.0进行了加密,所以url后面加了一长串参数,以前写在properties中是这样

url="jdbc:mysql://localhost:3306/lucene?useSSL=false&serverTimezone=Hongkong&characterEncoding=utf-8&autoReconnect=true"

但是当配置在xml中,由于遵循html字符实体规则,即

         --------------------空格------------- --------- 
        <--------------------小于号-----------&lt;-----------&#60;
        >--------------------大于号-----------&gt;-----------&#62;
        &--------------------和号------------&amp;-----------&#38;
        "--------------------引号------------&quot; ---------&#34;
        '--------------------撇号------------&apos;----------&#39;(IE不支持)
        ¢--------------------分-------------&cent;----------&#162;
        £--------------------镑--------------&pound;---------&#163;
        ¥--------------------日圆------------&yen;-----------&#165;
        €--------------------欧元------------&euro;----------&#8364;
        §--------------------小节------------&sect;----------&#167;
        ©--------------------版权------------&copy;----------&#169;
        ®--------------------注册商标---------&reg;-----------&#174;
        ™--------------------商标------------&trade;----------&#8482;
        ×--------------------乘号------------&times;----------&#215;
        ÷--------------------除号------------&divide;---------&#247;

作者:显魄-Simple
来源:CSDN
原文:https://blog.csdn.net/qq_33811662/article/details/80231312

则写在xml中应为

url="jdbc:mysql://localhost:3306/lucene?useSSL=false&amp;serverTimezone=Hongkong&amp;characterEncoding=utf-8&amp;autoReconnect=true"

踩坑两次,记下来或许会记忆深刻些?


全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务