1

I have just installed apache2, php7, and mariadb on a new ubuntu 20 install. I had a problem getting phpmyadmin to come up but fixed it with an older answer from ask ubuntu. But now I cannot log into my mariadb from phpmyadmin. I can log in by just sudo mysql on the terminal with the only password requested being my sudo password. I am thinking that the issue is what I found in the mariadb documentation below but I have no idea how to fix it. Somehow it seems I need to change the security back to passwords but I don't follow how to do it: "MariaDB starting with 10.4.3 In MariaDB 10.4.3 and later, the unix_socket authentication plugin is installed by default, and it is used by the 'root'@'localhost' user account by default. See Authentication from MariaDB 10.4 for more information.

The unix_socket authentication plugin allows the user to use operating system credentials when connecting to MariaDB via the local Unix socket file. This Unix socket file is defined by the socket system variable.

The unix_socket authentication plugin works by calling the getsockopt system call with the SO_PEERCRED socket option, which allows it to retrieve the uid of the process that is connected to the socket. It is then able to get the user name associated with that uid. Once it has the user name, it will authenticate the connecting user as the MariaDB account that has the same user name.

The unix_socket authentication plugin is not suited to multiple Unix users accessing a single MariaDB user account. " I have tried: <Directory "/var/www/html"> AllowOverride All and Include /etc/phpmyadmin/apache.conf

6
  • Ubuntu 20? There is no such release. Ubuntu uses yy.mm format (year.month of release) for all server & desktop releases, the yy being used only for IoT and specialist appliance/devices and cloud use that can use snap packages only. Please clarify which product you are using (year only releases mean a different product since 2016)
    – guiverc
    Commented Jan 27, 2021 at 0:29
  • 1
    You cannot use root with phpMyAdmin. You will need to create a separate account in the database with all privileges, and use that for phpMyAdmin.
    – user1091774
    Commented Jan 27, 2021 at 1:17
  • Apologies. The ubuntu is version 20.04.1 LTS which I just loaded.
    – Mike G
    Commented Jan 27, 2021 at 19:36
  • Matigo: Thanks. Can you give me instruction to do the account configuration? I will try to do it myself but if you can give them to me or point me in the right direction that would be great. Do you also know how to override the unix socket authentication and put it back to password authentication? I am thinking that may be the issue and it may effect any php program communication with mariadb. Many thanks for your help.
    – Mike G
    Commented Jan 27, 2021 at 19:42
  • The document I quoted from in my original question says that unix socket can be changed to password authentication but the instructions were very unclear to a novice such as myself.
    – Mike G
    Commented Jan 27, 2021 at 19:45

1 Answer 1

0

You cannot use root with phpMyAdmin. You will need to create a separate account in the database with all privileges, and use that for phpMyAdmin. – Matigo 2 days ago I followed the procedure from the tutorial at https://phoenixnap.com/kb/how-to-create-mariadb-user-grant-privileges to setup a new user and everything works good now as Matigo suggested.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .