A web interface for MySQL and MariaDB
GNU General Public License v2.0
6205
283
3210

Is your feature request related to a problem? Please describe.

As a final user, I would like to be able to do some repetitive tasks without having to interact with the web browser.
The most clear use case is uploading a new database dump automatically (i.e., my web site exposes data which is just a dump of some other databases used in my institution, which are updated on a daily basis).

As it's the product of my work, I would like our website to always show updated information, but I am just lazy to go and login phpmyadmin, upload a big mysql dump each day. Let me use a nightly script to prepare the dump do that work (original data are not in that server, but in local databases).

I have to stress that my request comes from a scenario where I have no direct access to the mysql server (and I am not the php site creator either: I am just the guy who curates the data behind): phpmyadmin is the only way offered by my institution (and by many ISPs also) to interact with our public database in a shared php-mysql hosting.
So I just want to stick to our IT staff policies, but please let's try to use phpmyadmin efficiently at least!!

Describe the solution you'd like

An API-like maintenance access? Perhaps something such as described in #15303 or requested in #15014 or #13319 (comment)
Basically, the ability to use a batch script to interact with phpmyadmin for 1) login and 2) running maintenance queries (i.e. just for simple daily database maintenance, like loading or updating data, or perhaps downloading database compressed dumps for backup purposes ... I am not talking about an api for all-kind of database queries, like extracting structured information in SELECT / JOIN queries or so).

But looking to answers in all those issues, an API access is not in phpmyadmin plans.
And I agree it could be too much work to implement that. So ...

Describe alternatives you've considered

  • Use some kind of php mysql-http tunnel instead of phpmyadmin. I didn't find any free/open source tool which really works.
  • Look for clients which can directly interact with phpmyadmin web interface. Perhaps with Selenium?(#13118 , #14565) I didn't find anything which works, but it's worth mentioning this Python approach:
  • The closest choice seems to be this orphan project by @fdev : https://github.com/fdev/phpmyadmin-cli
    It was a very simple yet functional python client (looking to users comments).
    Unfortunately, I couldn't make it work with phpmyadmin 5
    Perhaps you could take a look to fix that, or even consider to adopt this project under phpmyadmin umbrella?
    (1). it completely solves many use cases related in the above issues,
    (2). it offers a CLI so everybody can use it easily (a simple batch script will do)
    (3). you don't need to worry about creating an api anymore ... just keep phpmyadmin like it is (human interface), but keep it compatible with extant tools which permit to automate some repetitive tasks.

Additional context

  • phpMyAdmin version: 5.0.4deb2

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

When phpMyAdmin will run the command

GRANT ALL PRIVILEGES ON `csr\_wordpress`.* TO 'csr_wordpress'@'%';

it is added \ before the _. and for this reason the command is not working.

Expected behavior

The correct command would be

GRANT ALL PRIVILEGES ON csr_wordpress.* TO 'csr_wordpress'@'%';"

Screenshots

Captura de Tela 2022-10-04 às 14 55 39

Captura de Tela 2022-10-04 às 14 48 03

Server configuration

  • Docker phpMyAdmin Version: 5.0, 5.1 and latest
  • Mysql 8.0.30

Client configuration

  • Browser: Chrome
  • Operating system: Mac OS 12.6

Additional context

Add any other context about the bug here.

See Screenshot from phpMyAdmin v5.1.3.
image

"Go" and "Cancel" button not working properly in browser chrome version 105.0.5195.54.

In Firefox and Opera its working fine.
In Chrome its working only on very top and bottom of the button. In center of button with a click its do nothing.

I use phpMyAdmin v5.1.3 for localhost on my Notebook (included in XAMPP/Windows 11) and one on my webserver (included with Plesk Obsidian/AlmaLinux 8.6). Both v5.1.3 and both have this issue.

Describe the bug

The database table overview doesn't order the entries correctly when ordering by row count

To Reproduce

Steps to reproduce the behavior:

  1. Add tables which have a few thousand entries inside them
  2. Go to the structure overview of the whole database
  3. Click on "Rows" to order the table
  4. See error

Expected behavior

The rows should be ordered correctly by the values displayed in the table

Screenshots

image

Server configuration

  • Operating system: Debian 11
  • Web server: nginx 1.18.0
  • Database version: MariaDB 10.5.15
  • PHP version: 8.1.8
  • phpMyAdmin version: 5.2.0

Client configuration

  • Browser: Google Chrome 104.0.5112.79
  • Operating system: MacOS 12.5
  1. Missing CSP Policy

There is no CSP policy sent for PHPMyAdmin Setup:
http://127.0.0.1:81/phpMyAdmin-4.6.3-english/setup/

fix:
ensure CSP Policy is always sent for text/html responses.

Describe the bug

Not sure if it's FF or phpMyAdmin or something completely different but recently whenever I want to export anything (doesn't matter if it's sql or csv and if it's compressed or not) I'm getting weird message about FF not being able to read source file, which results in file not being downloaded/saved. The file placeholder is created at the destination but it's removed right after hitting confirmation on the window:
obraz
The message in the window can be translated as:

Downloading ...
File ... can not be saved because source file is not readable.
You should try later or contact server administrator.

I also tried that on older FF version (98dev) and there was no message but the file was empty.
Using View output as file works properly.

Also affects Safari: hestiacp/hestiacp#2529 (comment)

To Reproduce

Steps to reproduce the behavior:

  1. Go to any table.
  2. Click on Export.
  3. Choose to save as file.
  4. See error.

Server configuration

  • Operating system: ArchLinux
  • Web server: Apache/2.4.52
  • Database version: doesn't matter, tried this on few
  • PHP version: 8.1.4
  • phpMyAdmin version: 5.1.3

Client configuration

  • Browser: Firefox 99.0b5
  • Operating system: Win10

Describe the bug

Warning in .\libraries\classes\Dbal\DbiMysqli.php#209
mysqli::query(): (HY000/1034): Index for table 'global_priv' is corrupt; try to repair it

Backtrace

DbiMysqli.php#209: mysqli->query(
string 'SELECT 1 FROM mysql.user LIMIT 1',
integer 0,
)
DatabaseInterface.php#219: PhpMyAdmin\Dbal\DbiMysqli->realQuery(
string 'SELECT 1 FROM mysql.user LIMIT 1',
,
integer 0,
)
DatabaseInterface.php#1713: PhpMyAdmin\DatabaseInterface->tryQuery(string 'SELECT 1 FROM mysql.user LIMIT 1')
DatabasesController.php#92: PhpMyAdmin\DatabaseInterface->isSuperUser()
Routing.php#192: PhpMyAdmin\Controllers\Server\DatabasesController->__invoke(
,
array,
)
index.php#43: PhpMyAdmin\Routing::callControllerForRoute(
,
string '/server/databases',
,
,
)

I get this message when I am creating a new database for a new project. This message is display only after downloading the desktop version of localhost phpmyadmin before that all functions works properly.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://www.phpmyadmin.net/
  2. Click on download option
  3. Go to https://locallhost.me/phpmyadmin
  4. Click any of the link I click http://localhost/phpmyadmin
  5. See error (message)

Expected behavior

I expect to have a database for my new project.

Screenshots

Screenshot (40)

Server configuration

  • Operating system: Windows 11

Describe the bug

the latest stable release, 5.2.0, fail to report that mysqli is missing.

To Reproduce

Steps to reproduce the behavior:
create a Dockerfile with the content

FROM ubuntu:jammy
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update >/dev/null && apt-get install -y apt-utils >/dev/null 2>&1
RUN apt-get install -y nginx php-fpm curl wget > /dev/null
RUN echo 'server{ autoindex on;listen 81 default_server;listen [::]:81 default_server;root /var/www/html; index index.php; server_name _;location ~ \.php$ {include snippets/fastcgi-php.conf;fastcgi_pass unix:/run/php/php8.1-fpm.sock;}}' > /etc/nginx/sites-enabled/default;
RUN /bin/bash -c '\
service php8.1-fpm start; service nginx start; \
cd /var/www/html; \
wget "https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-english.tar.xz" -O pma.tar.xz; \
tar xfv pma.tar.xz; \
mv phpMyAdmin-* phpmyadmin; \
mkdir db; mv phpmyadmin db; \
curl localhost:81/db/phpmyadmin/ -v \
';

and run docker build . (or alternatively sudo docker build . - some systems need sudo to build dockerfiles and some systems doesn't, don't know why.)

Expected behavior

The mysqli extension is missing. Please check your PHP configuration.

Screenshots

it's a completely white page, don't think a screenshot is required for a white page.
seemingly due to a bug in Twig, that i found while investigating this. made a PR to Twig: twigphp/Twig#3749

Server configuration

  • Operating system: Ubuntu 22.04
  • Web server: nginx
  • Database version: irrelevant
  • PHP version: 8.1
  • phpMyAdmin version: 5.2.0

Client configuration

  • Browser: white page, 0 html, browser irrelevant
  • Operating system: Ubuntu 22.04

Additional context

This Twig issue seems to be related: twigphp/Twig#3749
here's a snippet of my investigation into a crashing phpmyadmin install,

dd File: /srv/http/default/www/db/phpmyadmin/vendor/twig/twig/src/Environment.php:527
string(10) "IT CRASHED"
string(299) "An exception has been thrown during the compilation of a template ("PhpMyAdmin\ConfigStorage\Relation::__construct(): Argument #1 ($dbi) must be of type PhpMyAdmin\DatabaseInterface, null given, called in /srv/http/default/www/db/phpmyadmin/libraries/classes/Twig/RelationExtension.php on line 22")."
object(TypeError)#1108 (7) {
  ["message":protected]=>
  string(228) "PhpMyAdmin\ConfigStorage\Relation::__construct(): Argument #1 ($dbi) must be of type PhpMyAdmin\DatabaseInterface, null given, called in /srv/http/default/www/db/phpmyadmin/libraries/classes/Twig/RelationExtension.php on line 22"
  ["string":"Error":private]=>
  string(0) ""
  ["code":protected]=>
  int(0)
  ["file":protected]=>
  string(80) "/srv/http/default/www/db/phpmyadmin/libraries/classes/ConfigStorage/Relation.php"
  ["line":protected]=>
  int(62)
  ["trace":"Error":private]=>
  array(18) {
    [0]=>
    array(5) {
      ["file"]=>
      string(80) "/srv/http/default/www/db/phpmyadmin/libraries/classes/Twig/RelationExtension.php"
      ["line"]=>
      int(22)
      ["function"]=>
      string(11) "__construct"
      ["class"]=>
      string(33) "PhpMyAdmin\ConfigStorage\Relation"
      ["type"]=>
      string(2) "->"
    }
    [1]=>
    array(5) {
      ["file"]=>

Describe the bug

Column visibility toggle function has the UI issue. Some columns cannot be selected because of the dropdown is behind other element layer.

To Reproduce

Steps to reproduce the behavior:

  1. Go to table browse data page (note: easy notice bug if select table with many columns but less data)
  2. Click on the arrow in front of id column
  3. See issue on the dropdown column(s) selector

Expected behavior

  1. The dropdown layer should be in front of Query results operations element.
  2. Checkbox and label should be in same line for better view.

Screenshots

Screen Shot 2565-10-02 at 23 52 30

Server configuration

  • Operating system: MacOS 12.5.1
  • Web server: Apache/2.4.54
  • Database version: mysql/8.0.30
  • PHP version: 8.1.11
  • phpMyAdmin version: master branch

Client configuration

  • Operating system: MacOS 12.5.1
  • Browser: Firefox 105.0.1 (64-bit)

Is your feature request related to a problem? Please describe.

As a person using a mobile or tablet, I want the correct keyboard to pop up when I search or edit a field in phpMyAdmin. At the moment, if I'm searching for a field which is an int or float the normal software keyboard appears and I have to manually switch it to number mode.

Describe the solution you'd like

<td data-type="bigint(20)">
   <input inputmode="numeric" type="text" id="fieldID_9" name="criteriaValues[9]" class="textfield">
   ...

Describe alternatives you've considered

HTML 5 provides a couple of ways to do this, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number

Additional context

  • phpMyAdmin version: 4.9.7

If this is something you're interested in, I'm happy to provide a PR.

The PhpMyAdmin\Dbal\DatabaseName and PhpMyAdmin\Dbal\TableName classes should be used as a type for the database and table names instead of using plain strings.

- public function foo(string $db, string $table)
+ public function foo(DatabaseName $db, TableName $table)

The current database and table names can also be got as strings using the $GLOBALS['db'] and $GLOBALS['table'] global variables. These should be using the value objects as well.

- $db = $GLOBALS['db'];
+ $db = DatabaseName::fromValue($GLOBALS['db']);

If you're willing to work on this, you don't need to change all cases before opening a pull request, you can change a small piece of code, test if it's working and then open a pull request. That will make your PR easier to review and merge.

Hi,

I have a strange case that is happening on a sharehosting server and I'm using innodb.
The IDS are set to autoincrement, primary, unique basic stuff.

Let say I have 3 entries in DB table ID1, ID2, ID3
If I delete 2 entries manually from PHPMyAdmin backend ID2, ID3 and export the DB
I can see AUTO_INCREMENT=4 so next ID should be ID4

If I go back let say 1 week later there are new entries but the IDS are wrong ID2, ID3 .. instead of ID4, ID5..

I cannot reproduce on my own server.

So something reset the ID but I just don't know what can cause this.
I have contacted my provider and they cannot help.

I don't have much info on the setup, server version seems v 5.37
The hosting company use DB name aliases.
Before when they was not using DB name aliases this problem was not happening so this is maybe related

Any clue?

mysql running on Debian 11, as a guest of macOS under VMware fusion
macos version 10.15.4 Catalina
browser = Brave Version 1.46.18 Chromium: 106.0.5249.65 (Official Build) nightly (x86_64)

This problem has been occurring for years somehow I managed to hack around it each time now I'd like to see it fixed if possible.

The error message from PHP my admin refers to SQL that is not part of what I've got in my query box. Specifically, the error message says the problem is near the limit clause of the sequel. That's what it always says when this proble,
occurs. It doesn't refer to other parts of the sequel just the limit clause that's not there.

Another difficult aspect of this problem is that it is not repeatable in other words it's happening now and it keeps happening now but later I wlll be able run this code exactly as it is and not get the error so I don't know what's causing it it's something inside PHP my admin. I might be forced to restart at least PHP my admin possibly my Web server for all I know maybe even my whole system.

Here is the sql in my query box right now:

create temporary table certsnap
SELECT  skey, certnum,  substring(certnum,1,7) as wiithout_checkdigit, snapshot as first_seen
FROM certz where snapshot ='2022-01-21 23:34:03'
order by skey;
alter table certsnap add index ( skey);

SELECT (t1.skey + 1) as gap_starts_at, 
       (SELECT MIN(t3.skey) -1 FROM certsnap t3 WHERE t3.skey > t1.skey) as gap_ends_at, (SELECT MIN(t3.skey) -1 FROM certsnap t3 WHERE t3.skey > t1.skey)-(t1.skey + 1) as gap_size
FROM certsnap t1
WHERE NOT EXISTS (SELECT t2.skey FROM certsnap t2 WHERE t2.skey = t1.skey + 1)
HAVING gap_ends_at IS NOT NULL
order by (t1.skey+1)';

When that sql is executed, the error message is:

Error
Static analysis:

1 errors were found during analysis.

Ending quote ' was expected. (near "" at position 387)
SQL query:  Documentation

SELECT (t1.skey + 1) as gap_starts_at, (SELECT MIN(t3.skey) -1 FROM certsnap t3 WHERE t3.skey > t1.skey) as gap_ends_at, (SELECT MIN(t3.skey) -1 FROM certsnap t3 WHERE t3.skey > t1.skey)-(t1.skey + 1) as gap_size FROM certsnap t1 WHERE NOT EXISTS (SELECT t2.skey FROM certsnap t2 WHERE t2.skey = t1.skey + 1) HAVING gap_ends_at IS NOT NULL order by (t1.skey+1)'; LIMIT 0, 25

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''; LIMIT 0, 25' at line 6

Describe the bug

When attempting to update packages with composer update in a phpMyAdmin instance installed using Composer (https://docs.phpmyadmin.net/en/latest/setup.html#installing-using-composer), the following errors appear:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpmyadmin/phpmyadmin is present at version 1.0.0+no-version-set and cannot be modified by Composer
    - roave/security-advisories dev-latest conflicts with phpmyadmin/phpmyadmin <5.1.3.
    - Root composer.json requires roave/security-advisories == dev-latest -> satisfiable by roave/security-advisories[dev-latest].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

To Reproduce

Steps to reproduce the behavior:

  1. $ composer create-project phpmyadmin/phpmyadmin --repository-url=https://www.phpmyadmin.net/packages.json --no-dev
  2. $ cd phpmyadmin
  3. $ composer update
  4. See above error

Expected behavior

composer update should not fail (AFAIR, it worked fine with the previous release).

Screenshots

N/A

Server configuration

  • Operating system: Ubuntu 20.04 LTS
  • Web server: N/A
  • Database version: N/A
  • PHP version: N/A
  • phpMyAdmin version: 5.2.0

Client configuration

  • Browser: N/A
  • Operating system: N/A

Additional context

composer update -W doesn't help.

Describe the bug

Cannot install additional package with zipped file.

I know that composer packages are preinstalled, but adding new package was working just fine with version 5.1.1.

To Reproduce

Steps to reproduce the behavior:

wget -q -c https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-english.tar.gz -O - | tar -xz --strip-components 1
composer install / composer require some-package

Expected behavior

Successful install of package.

What happens

composer fails with:

composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - phpmyadmin/phpmyadmin is present at version 1.0.0+no-version-set and cannot be modified by Composer
    - roave/security-advisories dev-latest conflicts with phpmyadmin/phpmyadmin <5.1.3.
    - roave/security-advisories is locked to version dev-latest and an update of this package was not requested.

What I think is happening - composer.json is missing explicit version declaration.

Yeap, explicitly adding "version": "5.2.0" to composer.json worked.

Probably worth rethinking zip strategy?

well, it would be nice to have a "basics" tarball without as much as possible 3rd party stuff not present at all instead the "rm -rf" orgy in phpMyAdmin.spec to begin with

Originally posted by @thelounge-zz in #16396 (comment)

Describe the bug

On a fresh install with PHP 8.1 and phpMyAdmin with Ubuntu PPA, I obtain the Login page and can login successfully.
After login, I can see only the horizontal menu.
On the left menu, the databases names appear very briefly and then disapear immediatly.

Browser console reports :
Uncaught SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at Object.success (functions.js?v=5.1.3deb1%2Bfocal2:5430:30)
at fire (jquery.min.js?v=5.1.3deb1%2Bfocal2:2:12157)
at Object.fireWith [as resolveWith] (jquery.min.js?v=5.1.3deb1%2Bfocal2:2:13328)
at done (jquery.min.js?v=5.1.3deb1%2Bfocal2:4:27808)
at XMLHttpRequest. (jquery.min.js?v=5.1.3deb1%2Bfocal2:4:31149)

To Reproduce

Steps to reproduce the behavior:

  1. install Ubuntu 20.04
  2. install PHP 8.1 (ppa:ondrej/php)
  3. install mysql-server
  4. install phpmyadmin (ppa:phpmyadmin/ppa)

Expected behavior

Full page with databases should appear after login

Screenshots

If applicable, add screenshots to help explain the bug.

Server configuration

  • Operating system: Ubuntu 20.04.3
  • Web server: Apache2
  • Database version: mysql Ver 8.0.28
  • PHP version: 8.1.3
  • phpMyAdmin version: 5.1.3 (4:5.1.3+dfsg1-1+focal2)

Client configuration

  • Browser: Chrome/Firefox/Edge
  • Operating system: Windows

Thanks for your help

phpmyadmin-issue

Describe the bug

When using "Move Columns" for a table with ENUM fields, you cannot move any ENUM type fields below another field (of any type) without encountering an erroneous "Invalid default value" error.

Edit: this same phenomenon exists with VARCHAR fields as well. (have not tested other types, but may apply to others)

Edit 2: additionally, this bug appears to be replacing [EMPTY] default values for VARCHAR fields with double apostrophes ('')

To Reproduce

Make a table with a handful of INT, VARCHAR, etc fields and one or two ENUM fields.
Click "Move Columns"
Drag and drop a field that was below an ENUM field, above the ENUM field -- SUCCESS! (no errors)
Drag and drop a field that was above an ENUM field, below an ENUM field -- ERROR! ("Invalid default value for [name of highest ENUM field in the table]")

Expected behavior

Move an ENUM field up or down in the column order

Screenshots

PMA Column Move Bug w notes

Server configuration

  • Operating system: centOS v7.9.2
  • Web server: Apache
  • Database version: 10.6.9-MariaDB
  • PHP version: 8.0
  • phpMyAdmin version: 4.9.7

Client configuration

  • Browser: Firefox and Chrome
  • Operating system: Windows 11

Currently the PHPMyadmin search field only allows searching tables. For mass productions this ends up being unprofitable. It would be interesting if we could use the same field to search for columns, as this would make a huge difference in large applications.

Thanks for listening! :)

QA_5_2 and master have a problem if blowfish_secret isn't exactly 32 bytes long. The main pane is blank aside from the top tabs and this is logged:

PHP Fatal error:  Uncaught ErrorException: The secret passphrase in configuration (blowfish_secret) is not the correct length. It should be 32 bytes long. in /var/www/pma-dev/fork/libraries/classes/Controllers/HomeController.php:330\nStack trace:\n#0 [internal function]: PhpMyAdmin\\ErrorHandler->handleError()\n#1 /var/www/pma-dev/fork/libraries/classes/Controllers/HomeController.php(330): trigger_error()\n#2 /var/www/pma-dev/fork/libraries/classes/Controllers/HomeController.php(220): PhpMyAdmin\\Controllers\\HomeController->checkRequirements()\n#3 /var/www/pma-dev/fork/libraries/classes/Routing.php(187): PhpMyAdmin\\Controllers\\HomeController->__invoke()\n#4 /var/www/pma-dev/fork/index.php(43): PhpMyAdmin\\Routing::callControllerForRoute()\n#5 {main}\n  thrown in /var/www/pma-dev/fork/libraries/classes/Controllers/HomeController.php on line 330

We should definitely handle this more gracefully and show the user a warning that their blowfish_secret isn't the correct length.