phpmyadmin error 1064 (42000) during installation

2019-08-29 13:05发布

问题:

I'm quite confused about an error while installing phpmyadmin on a Debian server with MySQL already installed and configured. I've already tried to purge the latest phpmyadmin failed installations, but I'm not being able to installing it.

I've also already searched for common questions as trying to fix phpmyadmin files as https://serverfault.com/questions/341116/setting-up-phpmyadmin-got-a-mysql-syntax-error but every timestamp call is correct without values ( timestamp(value) seems to be wrong).

If anyone could help me I'd be so grateful!

The error says:

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>                               

回答1:

Ok, I solved my problem by doing the following steps:

  1. Removing completely phpmyadmin and mysql:

    sudo remove phpmyadmin + sudo remove mysql

    sudo purge phpmyadmin + sudo purge mysql)

  2. Upgrading the dist: sudo apt-get dist-upgrade

  3. Reinstalling everything (phpmyadmin + mysql)

  4. Later I had other kind of issues related about users and passwords in phpmyadmin, but I've solved them with that query:

mysql -u root mysql

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

FLUSH PRIVILEGES;

exit;

Source: Can't set root MySQL password to null