Hello stackoverflow-community!
When I try to install and afterwards configure my phpmyadmin on my debian server I always get this error-message.
ERROR 1064 (42000): 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 'debian123'' at line 1
I am using: debian version: 9 ; MySql version: 8.0.19
What I tried:
- deleted phpmyadmin and reinstalled it
- tried another statement to grant privileges to the user
I hope you can help me with my problem, because I am struggeling with it quite a while.
thank you in advance
~HTL_Krems_Engineer
2
Answers
This is a change with newer versions of MySQL.
You can no longer use
grant x on y.z to username identified by 'debian123'
.You have to split the user creation into multiple steps.
Your MySQL should look like this instead:
It sounds like perhaps you’ve got an older phpMyAdmin installed, which could happen because by default the backports repository is pinned to 100. You have to use a command like
apt-get -t stretch-backports install phpmyadmin
to force the newer version to install.Stretch comes with phpMyAdmin 4.6.6, and perhaps the post-install script (the screenshot you’ve attached) doesn’t know the newer syntax for creating users for recent MySQL versions. The backports version is 4.9.5, which is better meant for the newer MySQL variants.
One alternative workaround would be to to answer no to the question asking if you want the package manager to create the phpMyAdmin database, then to either not use the advanced features at all or manually create the controluser and linked tables.