安装过程中phpmyadmin错误1064(42000)

时间:2018-11-10 11:01:29

标签: mysql database phpmyadmin installation failed-installation

对于在已安装和配置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>                               

3 个答案:

答案 0 :(得分:1)

如果您正在使用或升级到MySQL 8,则默认身份验证插件为caching_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”替换为“ your root password”

ALTER USER user IDENTIFIED WITH caching_sha2_password BY 'password';

FLUSH PRIVILEGES;

来源dev.mysql.com

答案 1 :(得分:0)

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

  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

答案 2 :(得分:0)

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

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

真的希望这对遇到同样问题的人有所帮助。最后,请使用这篇文章手动安装phpMyAdmin https://www.digitalocean.com/community/questions/how-to-install-manually-phpmyadmin-on-ubuntu

相关问题