I tried installing phpmyadmin on Debian Squeeze with a nginx and mysql-server installed. I ran sudo apt-get install phpmyadmin, and all appeared to be going well until setup threw me this:
An error occurred while installing the database:
mysql said: ERROR 1064 (42000) at line 72: 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 '(14) NOT NULL, `sqlquery` text NOT
NULL, PRIMARY KEY (`id`), KEY `usernam' at line 6
i really struggled with this issue while setting up a server on Digital Ocean. I needed a server to Host a Laravel application. Basically i had to setup my server by installing Nginx using this Tutorial, then i installed MYSQL Version 8.0.22 using this Tutorial (basically the latest available version - Which usually leads to this error), then i installed PHP7.4 using this Tutorial of which also required me to check the DigitalOcean article to configure the php processor for Nginx using the same Tutorial i used to install Nginx.
At this point i wanted to install phpMyAdmin, and it failed with the same error, i read every article i could find on Digital Ocean, Stackoverflow and other forums and no solution worked. I found out i could download phpMyAdmin version 5.0.4 or greater (Basically the latest version) from the official website since it would be more compatible with the MYSQL Version 8.0.22. I followed this Tutorial exactly to install phpMyAdmin manually instead of automatically and everything worked perfectly! I was able to open the phpMyAdmin on the browser and even able to login using root and password. I created another user as indicated on the tutorial and was also able the login using that new user.
apt-get cleanand try again. If if didn't work, you can download the phpmyadmin source code and extract to Apache document root.