使用Pycharm连接MySQL时遇到如下问题,错误代码[08001]

查了很多资料归纳一下可能是如下几个原因

0、mysql.server没开

找到对应系统下的mysql.server 启动/重启命令

 macbookpro@jcx ~$ mysql.server restart
Shutting down MySQL
... SUCCESS!
Starting MySQL
.. SUCCESS!
macbookpro@jcx ~$

1、时区问题

jdbc:mysql://localhost:3306/youdatabasename?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

复制  ?到结尾的所有内容并粘贴到URL中, 设置TIMEZONE为UTC  不行的话将UTC改为Asia/Shanghai 或者 HongKong 再试

2、Mysql版本问题

在终端命令行模式下查看自己的Mysql版本  输入 mysql --version

 macbookpro@jcxioo-2 ~$ mysql --version
mysql Ver 8.0.17 for osx10.14 on x86_64 (Homebrew)

再查看Pycharm 里面的Mysql是不是版本相近  统一成8或者5

统一版本后继续test connect

3、最后一招

把database 里面的名字删了,等连接成功后再进行创建操作

成功连接上mysql后,命令行内输入

 mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec) mysql> create database new;
Query OK, 1 row affected (0.01 sec) mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| new |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec) mysql>

Pycharm连接Mysql失败. [08001] Could not create connection to database server.的更多相关文章

  1. Connection to 天mysql failed. [08001] Could not create connection to database server. Attempted ,报错处理方法

    https://blog.csdn.net/myzh215219/article/details/90314345 点击图上的DRIVER,然后点击GO TO DRIVER,之后更改合适的驱动. 我的 ...

  2. pycharm2019连接mysql错误08801 ------Connection to django1@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.

    Error:Connection to django1@localhost failed. [08001] Could not create connection to database server ...

  3. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up IDEA2019的database插件无法链接mysql的解决办法(08001错误)

    [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up. 点击这里 ...

  4. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.

    使用idea连接数据库的时候,报错为 [08001] Could not create connection to database server. Attempted reconnect 3 tim ...

  5. pycharm连接mysql是出现Connection to orm02@127.0.0.1 failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.

    下面这个问题反正我是遇到了,也是难为我好几天,于是我决定发一个教程出来给大家看看!希望能帮助你们 原因: 可能是数据库的版本与本机装的驱动不匹配导致的, 解决方案一: 在 url 后面街上一句 因为笔 ...

  6. pycharm2019连接mysql错误:08801 ------Connection to django1@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.

  7. IntelliJ IDEA连接不上数据库 (Connection to testdb@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.)

    问题提示为: 原因:MySQL数据库版本为8.0以上,需要在URL加上时区,即加上?serverTimezone=GMT 成功后为:

  8. java项目连接jdbc报错:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server

    java项目连接jdbc报错:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not creat ...

  9. jmeter连接mysql数据库报错Cannot create PoolableConnectionFactory (Could not create connection to database server.)

    今天在学习jmeter的jdbc取样器,发现在配置完JDBC Connection Configuration和JDBC Request后,点击运行.在查看结果树中显示响应数据: Cannot cre ...

随机推荐

  1. CSS - 定位(position),难点

    元素的定位属性主要包括定位模式和边偏移两部分. 1. 边偏移 边偏移属性 描述 top 顶端偏移量,定义元素相对于其父元素上边线的距离 bottom 底部偏移量,定义元素相对于其父元素下边线的距离 l ...

  2. Input输入框日期控件

    案例 https://pan.baidu.com/s/1i6BNLcT   密码:p77m

  3. Linux学习计划中遇到的问题记录

    随时更新 Linux安装到网络联通遇到的问题及解决办法 1.命令区分大小写 2..网络连通 ping本地 地址遇到问题 解决办法: https://blog.csdn.net/qq_42074075/ ...

  4. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:"text-danger" 类的文本样式

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  5. CSS相关(2)

    特效:       2D:              平移:可以为负值,单位px transform:translateX(200px) translateY(200px); 简写:transform ...

  6. HDU 5506:GT and set bitset+暴力

    GT and set  Accepts: 35  Submissions: 194  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 655 ...

  7. tomcat点击startup.bat出现闪退,启动不成功的解决办法

    问题描述:tomcat点击startup.bat出现命令行闪退的情况 打开startup.bat,在第一行加入 SET JAVA_HOME=D:\jdk\jdk1.8.0_121[jdk路径] SET ...

  8. hadoop的扩容

    一.横向扩容(参见:https://www.cnblogs.com/yangy1/p/12362565.html) 现在在此基础上再添加一个节点 1.克隆一台主机hdp03(克隆hdp02) 修改ip ...

  9. 刷题55. Jump Game

    一.题目说明 题目55. Jump Game,给定一组非负数,从第1个元素起,nums[i]表示你当前可以跳跃的最大值,计算能否到达最后一个index.难度是Medium. 二.我的解答 非常惭愧,这 ...

  10. 51nod 1445:变色DNA 最短路变形

    1445 变色DNA 题目来源: TopCoder 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题  收藏  关注 有一只特别的狼,它在每个夜晚会进行变色,研究发现 ...