使用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. 「ZJOI2006」物流运输

    题目 [内存限制:$256MiB$][时间限制:$1000ms$] [标准输入输出][题目类型:传统][评测方式:文本比较] [题目描述] 物流公司要把一批货物从码头 A 运到码头 B.由于货物量比较 ...

  2. SessionAttributes注解

    SessionAttributes注解: a.该注解只能应用在类上: b.该注解用于将Map.ModelMap.Model或ModelAndView中的数据暂存到HttpSession中以使其可以在多 ...

  3. DeepCTR-Torch

    仅作学习使用 在ubuntu安装成功了,可以运行example.jump2 但是在mac没有成功,报错 ImportError: No module named torch

  4. Iptables与LVS——从入门到放弃

    防火墙什么是防火墙?防火墙其实就是一个隔离的工具,工作于主机或者网络的边缘,对于进出本主机或者网络的报文根据事先定义好的网络规则做匹配监测.防火墙可以简单地划分为两大类:主机防火墙 网络防火墙     ...

  5. eclipse不能启动,An internal error occurred during: "reload maven project".

    An internal error occurred during: "reload maven project". 这个错误是因为项目已经关闭,导致 导致此问题的原因是Sprin ...

  6. Python可视化 | Seaborn包—heatmap()

    seaborn.heatmap()的参数 seaborn.heatmap(data, vmin=None, vmax=None, cmap=None, center=None, robust=Fals ...

  7. mysqlworkbench导入sql文件

    直接给上神秘地址怕自己以后忘记:https://blog.csdn.net/u010801439/article/details/78762387

  8. Lesson 3 Matterhorn man

    What was the main objective of early mountain climbers? Morden alpinists try to climb mountains by a ...

  9. 在React中随机生成图形验证码

    各个方法 在输入框中定义一个位置存放图形 完整代码 方便复制粘贴 import React, { Component } from 'react'; import styles from './lef ...

  10. jenkins -- 安装、任务构建

    一.jenkins是什么? Jenkins是一个开源的.提供友好操作界面的持续集成(CI)工具,起源于Hudson(Hudson是商用的),主要用于持续.自动的构建/测试软件项目.监控外部任务的运行( ...