【问题标题】:phpmyadmin error 1064 (42000) during installation安装期间 phpmyadmin 错误 1064 (42000)
【发布时间】:2019-04-13 18:20:10
【问题描述】:

在已经安装和配置了 MySQL 的 Debian 服务器上安装 phpmyadmin 时,我很困惑。我已经尝试清除最新的 phpmyadmin 失败安装,但我无法安装它。

我也已经搜索了一些常见问题,例如尝试将 phpmyadmin 文件修复为 https://serverfault.com/questions/341116/setting-up-phpmyadmin-got-a-mysql-syntax-error,但每个 timestamp 调用在没有值的情况下都是正确的(timestamp(value) 似乎是错误的)。

如果有人可以帮助我,我将不胜感激!

错误提示:

An error occurred while installing the database: 

 │                                                                             
 │ mysql said: ERROR 1064 (42000) at line 1: You have an error in your SQL     
 │ syntax; check the manual that corresponds to your MySQL server version      
 │ for the right syntax to use near 'IDENTIFIED BY                             
 │ 'hereismypassword'' at line 1 . Your options are:               
 │  * abort - Causes the operation to fail; you will need to downgrade,        
 │    reinstall, reconfigure this package, or otherwise manually intervene     
 │    to continue using it. This will usually also impact your ability to      
 │    install other packages until the installation failure is resolved.       
 │  * retry - Prompts once more with all the configuration questions           
 │    (including ones you may have missed due to the debconf priority          
 │    setting) and makes another attempt at performing the operation.          
 │  * retry (skip questions) - Immediately attempts the operation again,       
 │                                                                             
 │                                  <Ok>                               

【问题讨论】:

  • 您使用的是哪个 Debian 版本?您使用的是 MySQL 还是 MariaDB,是通过包管理器安装的还是您自己通过其他方式安装的?
  • Debian 9 (Stretch) (64 bits),使用通过 apt-get 安装的 MySQL

标签: mysql database phpmyadmin installation failed-installation


【解决方案1】:

如果您正在使用或升级到 MySQL 8,默认的身份验证插件是缓存_sha2_password

编辑/etc/mysql/my.cnf/etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]

下添加以下行
default-authentication-plugin=mysql_native_password

然后重启mysql服务并连接到你的MySQL

service mysql restart 

mysql -u root -p

然后执行以下命令,将'password'替换为'你的root密码'

ALTER USER user IDENTIFIED WITH caching_sha2_password BY 'password';

FLUSH PRIVILEGES;

来源dev.mysql.com

【讨论】:

    【解决方案2】:

    Digital Ocean 上设置服务器时,我确实遇到了这个问题。我需要一台服务器来托管 Laravel 应用程序。基本上我必须通过使用这个Tutorial 安装Nginx 来设置我的服务器,然后我使用这个Tutorial 安装MYSQL Version 8.0.22(基本上是最新的可用版本 -这通常会导致这个错误),然后我使用这个Tutorial 安装了 PHP7.4,其中还需要我查看 DigitalOcean 文章以为 Nginx 配置 php 处理器使用与我安装 Nginx 相同的 Tutorial

    此时我想安装 phpMyAdmin,但由于同样的错误而失败,我阅读了在 Digital Ocean、Stackoverflow 和其他论坛上可以找到的所有文章,但没有解决方案。我发现我可以从官方网站下载 phpMyAdmin 5.0.4 或更高版本(基本上是最新版本),因为它与 MYSQL 8.0.22 版本更兼容.我完全按照Tutorial手动安装 phpMyAdmin 而不是自动安装,并且 一切运行良好! 我能够在浏览器上打开 phpMyAdmin,甚至能够使用 root 登录和密码。我按照教程中的说明创建了另一个用户,并且还能够使用该新用户登录。

    真的希望这可以帮助遇到同样问题的人。总之,使用本文手动安装 phpMyAdminhttps://www.digitalocean.com/community/questions/how-to-install-manually-phpmyadmin-on-ubuntu

    【讨论】:

      【解决方案3】:

      好的,我通过以下步骤解决了我的问题:

      1. 彻底删除phpmyadmin和mysql:

        sudo remove phpmyadmin + sudo remove mysql

        sudo purge phpmyadmin + sudo purge mysql)

      2. 正在升级dist:sudo apt-get dist-upgrade

      3. 重新安装一切(phpmyadmin + mysql)

      4. 后来我在 phpmyadmin 中遇到了与用户和密码相关的其他类型的问题,但我已经通过该查询解决了这些问题:

      mysql -u root mysql

      UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root';

      FLUSH PRIVILEGES;

      exit;

      来源:Can't set root MySQL password to null

      【讨论】:

      • 你的意思是sudo apt-get remove phpmyadmin
      • 一年后我在 ubuntu18 和 mysql8 上遇到了同样的错误
      猜你喜欢
      • 1970-01-01
      • 2011-12-06
      • 2016-11-25
      • 2018-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-06
      相关资源
      最近更新 更多