0

I upgraded from Ubuntu 20.04 to Ubuntu 22.04. After that, phpMyAdmin would not work. Attempts to open phpMyAdmin showed a blankpage, or a "connection refused" page.

From the apache2 error.log:

> [Mon Sep 26 17:46:34.097236 2022] [php:error] [pid 1055] [client
> ::1:37214] PHP Fatal error: Uncaught mysqli_sql_exception: SELECT
> command denied to user 'peter'@'localhost' for table 'user' in
> /var/www/html/phpMyAdmin/libraries/classes/Dbi/DbiMysqli.php:199\nStack
> trace:\n#0
> /var/www/html/phpMyAdmin/libraries/classes/Dbi/DbiMysqli.php(199):
> mysqli->query()\n#1
> /var/www/html/phpMyAdmin/libraries/classes/DatabaseInterface.php(316):
> PhpMyAdmin\\Dbi\\DbiMysqli->realQuery()\n#2
> /var/www/html/phpMyAdmin/libraries/classes/DatabaseInterface.php(2390):
> PhpMyAdmin\\DatabaseInterface->tryQuery()\n#3
> /var/www/html/phpMyAdmin/libraries/classes/DatabaseInterface.php(2332):
> PhpMyAdmin\\DatabaseInterface->isUserType()\n#4
> /var/www/html/phpMyAdmin/libraries/server_common.inc.php(43):
> PhpMyAdmin\\DatabaseInterface->isSuperuser()\n#5
> /var/www/html/phpMyAdmin/index.php(116): include('...')\n#6 {main}\n
> thrown in /var/www/html/phpMyAdmin/libraries/classes/Dbi/DbiMysqli.php
> on line 199

As root I gave myself all privileges on table user

The command line says phpmyadmin is installed and the latest version:

> phpmyadmin is already the newest version (4:5.1.1+dfsg1-5ubuntu1).

What is necessary to make it work from Ubuntu, without downloading it again?

To get phpMyAdmin working, I did the following:

You should have MySQL server working and have user privileges on a database.


To get phpMyAdmin working on Ubuntu:

  1. Delete the existing phpMyadmin folder in /var/www/html/

  2. Download the latest version from https://www.phpmyadmin.net/downloads/

  3. Unzip the file

  4. Rename the folder phpMyAdmin (get rid of the language part)

  5. Move it to /var/www/html/

  6. Set the permissions:

    sudo chown -R pedro /var/www/html

    sudo chgrp -R www-data /var/www/html/

    sudo chmod -R 770 /var/www/html/

    sudo chmod g+s /var/www/html/

After that, it should just work!


What should I have done to make it work Ubuntu-style?

In Ubuntu, where should the phpMyAdmin folder be put??

As it is now, localhost/phpMyAdmin/ leads to the index file of /var/www/html/phpMyAdmin/ and everything is working.

4
  • 1
    Please edit your question to elaborate on what exactly you mean by "would not work". Did you get an error message? If so, please quote it verbatim and also mention when and where it appeared. Did you get some output which differed from what you expected? Again, mention what it is, how it differs from your expectation and how you triggered it. Keep in mind that we cannot see what goes on on your system.
    – Tilman
    Sep 27, 2022 at 0:10
  • Upgraded from what? Please add this info to the question with EDIT.
    – David
    Sep 27, 2022 at 5:49
  • It looks like you self-installed phpmyadmin rather than using phpmyadmin from Ubuntu. As such the correct setup and config of that version of it may be outside the expertise or scope of here. Can you say which MySQL or MariaDB you're using? When you say "As root I gave myself all privileges on table user" are you referring to the MySQL user called "peter"? Sep 27, 2022 at 9:32
  • I use the MySQL that comes with Ubuntu. That's really my question I suppose: How am I supposed to use the phpmyadmin that comes with Ubuntu? I don't know where it is, but I believe it has to be in /var/www/html/ or the browser won't find it: localhost/phpMyAdmin/index.php Is there some other, Ubuntu-style way to do this?? phpMyAdmin runs in a browser.
    – Pedroski
    Sep 27, 2022 at 22:40

0

You must log in to answer this question.

Browse other questions tagged .