I have a raspberry that I use as a development web server. The other day I had to reinstall the OS and when I tried to reinstall everything I have some problems.

When I installed MySql I saw that I wasn't asked for a root password like the last time. I investigated a bit, and saw that I have installed MariaDB instead of MySql, and that MariaDB changed the login system with something like UNIX_SOCKET that use the root user of the system.

The problem is that when I'm trying to install phpmyadmin, I'm asked for the root password during the installation.

I've seen a lot of messages saying to disable the UNIX_SOCKET and use the old system. I put a password to the root user but during the installation it says Access denied for 'root'@'localhost' using password YES, sometimes it says NO.

What I can I do to install phpmyadmin?

I'm installing it through ssh and I tried to connecting a keyboard directly to the raspberry and it doesn't works too.

  • Sounds like you should reinstall your OS and install the correct application. You could also reverse the changes MariaDB made to your system, but that might be difficult, if you don't have access to root – Ramhound Aug 30 '17 at 14:04

MariaDB is essentially forked MySQL so they work the same.
With a clean installation there is a root user with no password, so you can just connect via commandline by not specifying -p (run in the shell: mysql -u root). By default both mysql and mariadb use a linux socket for local connections, but this doesn't have anything to do with how the password is set or used. To not use a socket, you specify in cli mysql client -h then the client will use tcp connection to the host. Likewise, if you tell phpmyadmin to connect to localhost it will use a socket and if you tell it to connect to or the hostname of the server, it will use a tcp connection. To update/reset the root password see instructions here: https://www.howtoforge.com/setting-changing-resetting-mysql-root-passwords

  • Ok, now it's working. I removed everything related to mysql or phpmyadmin and tried it again. When I was asked for a password in phpmyadmin I just pressed enter and it installed everything. Later I used sudo mysql -u root to access to MariaDB and created a new user with full privileges to be able to log in phpmyadmin. Thanks! – aenon83 Aug 30 '17 at 15:05
  • Good to hear, and no problem! – Elias Aug 30 '17 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.