AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1133664
Accepted
user9371654
user9371654
Asked: 2019-04-14 14:09:41 +0800 CST2019-04-14 14:09:41 +0800 CST 2019-04-14 14:09:41 +0800 CST

升级到 8.0 版后无法连接 MySQL 数据库

  • 772

我将 MySQL 工作台升级到 8.0 版,将 MySQL 服务器升级到 8.0.15 版。我重新启动计算机并打开工作台。我找到了我的旧联系。当我单击测试连接时,我得到了成功的结果。

在此处输入图像描述

当我双击我的连接时,我收到此错误消息。

在此处输入图像描述

我尝试使用并重置密码登录到 MySQL 服务器:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

请问,可能是什么问题?
当我在旧版本中建立连接时,我忘记了端口号是什么。

编辑:

在终端中,这是一次尝试,似乎有效。只是我以前工作的工作台。请注意,我使用的是 Ubunut 18.04:

$ mysql -u root -p -h 127.0.0.1 -P 3306
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 37
Server version: 8.0.15 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
networking server upgrade mysql mysql-workbench
  • 2 2 个回答
  • 4036 Views

2 个回答

  • Voted
  1. Af1ne
    2019-04-14T14:43:16+08:002019-04-14T14:43:16+08:00

    SQL v8.0 更改了身份验证协议:
    在 v8.0 上,它使用caching_sha2_password.
    之前是mysql_native_password。

    要在以前的版本上创建新用户,它是:

    GRANT ALL PRIVILEGES ON *.* TO 'rootV5'@'localhost' WITH GRANT OPTION;
    

    要在 v8.0 上创建新用户,请运行以下命令(当然,用您自己的方式替换 root 和密码!):

    CREATE USER 'rootV8'@'%' IDENTIFIED BY 'password'; 
    GRANT ALL PRIVILEGES ON *.* TO 'rootV8'@'%' WITH GRANT OPTION;
    

    要更改旧版本用户的密码加密:

    ALTER USER 'user'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';
    

    我希望你能解决你的问题:)

    • 2
  2. Best Answer
    Kulfy
    2019-04-14T15:18:46+08:002019-04-14T15:18:46+08:00

    来自评论:

    您收到的错误消息是:

    The user specified as a definer ('mysql.infoschema'@'localhost') doesn't exist.
    

    为了解决这个问题,运行,

    mysql_upgrade -u root -p
    mysql_install_db
    

    在终端。如果不能解决问题,运行

    > create user 'mysql.infoschema'@'localhost';
    

    在 MySQL 中。

    • 1

相关问题

  • 如果在服务器机器上运行 Ubuntu 桌面版,性能损失是多少?

  • 将桌面版剥离为服务器版的最简单方法是什么?

  • 分销升级的合理途径

  • 如何与无头服务器进行图形交互?

  • 在不使用标准升级系统的情况下升级有哪些替代方案?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve