这个异常特别烦人,是mysql连接驱动的问题,可以用二步解决:

第一步
从网上下载驱动,从mysql-connector-java_8.0.16-1ubuntu16.04_all.deb里边提取出mysql-connector-java-8.0.16.jar,如下:
pycharm中连接MySql出现  Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.的错误解决
第二步
点击右上角的“+”,把jar格式的包添加进行
pycharm中连接MySql出现  Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.的错误解决
pycharm中连接MySql出现  Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.的错误解决

调试成功,如图所示:
pycharm中连接MySql出现  Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.的错误解决

pycharm中连接MySql出现  Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.的错误解决

相关文章:

  • 2021-07-13
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
猜你喜欢
  • 2021-09-19
  • 2021-09-11
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2021-10-31
相关资源
相似解决方案