1
June
2020
9:39

How to update phpmyadmin

1 June 2020 9:39

The Web utility PHPMYADMIN is used by the software developers to create and modify MySQL databases. After a few years of using this program, in connection with the transition to the newer MySQL 5.7.30 and PHP 7.2, it was necessary to update the phpmyadmin until the latest version ...

Update the version of PHPMYADMIN

  1. First of all, I determined where PHPMYADMIN is installed, for which I completed the search in the catalog with the configuration of the Apache2 web server:

    cd /etc/apache2
    grep -R "phpmyadmin"

Judging by alias/phpmyadmin/usr/share/phpmyadmin and <directory/usr/share/phpmyadmin>
The program is installed in the folder /usr/share.

  1. I moved to the folder /usr/share и попытался найти документацию

    cd /usr/share/phpmyadmin
    cd doc
    cd html
    ls

  2. Now I opened a file in Firefox browser

    file:///usr/share/phpmyadmin/doc/html/index.html

  3. In the section " upgrading from An Older Version " there is a detailed description of the update.

  4. At the beginning of the document, a warning suggests that you can not recording (grout) the old version of the new. You need to take config.inc.php from the old version and on top of the newly unpacked. Old files cannot be left for security reasons.

Warning
NEVER EXTRACT The New Version Over An Existing Installation of PhpMyadmin, Always Firast Remove the Old Files Just Just the Configuration.

This Way You Will Not Leave Old No Longer Working Code in the Directory, Which Can Savere Seciation Implications Or Can Cause Various Breakages.

Simply Copy Config.inc.php From Your Previous Installation Into the Newly Unpacked One.

  1. I move directly to the replacement of the version:

    su -
    cd /usr/share/
    mv phpmyadmin phpmyadmin.old
    mkdir phpmyadmin
    cd phpmyadmin
    wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.zip

(Zip was spied on the Way to the ZIP file https://www.phpmyadmin.net/ по ссылке "Download")

unzip phpMyAdmin-5.0.2-all-languages.zip
ls

I solve a small problem: the files hit the "PhpMyadmin-5.0.2-all-languages" folder instead of the current catalog

cp -rp phpMyAdmin-5.0.2-all-languages/* .
rm phpMyAdmin-5.0.2-all-languages -R
  1. I launch http: // localhost/phpmyadmin in the browser

  2. An invitation appears - I enter the name of the user Root and the password. Everything works, the version is relevant!

phpmyadmin information about the version: 5.0.2 (relevant)

Solving the problem

At the end of the page there are two warnings

  • In the configuration file, you need to set the password phrase (BlowFish_Secret).
  • The value of the constant $Cfg['TempDir'] points to the directory /usr/share/phpmyadmin/tmp/ which is not accessible. Because of this, PHPMYADMIN cannot cache the templates and will be slow.

We solve the first problem.

  1. Check that the file exists and is not empty

    cat /usr/share/phpmyadmin/config.inc.php

    cat: /usr/share/phpmyadmin/config.inc.php: Нет такого файла или каталога

  2. You need to create a configuration file. For a sample, take the phpMyadmin file "config.sample.inc.php" .

I am performing the command:

su -
cd /usr/share/phpmyadmin/
cp config.sample.inc.php config.inc.php

  1. In the configuration file config.inc.php, you need to fix the secret phrase for cookies.
    Open the config.inc.php file for editing:

    nano /usr/share/phpmyadmin/config.inc.php

I correct the secret key - its length should be 32 characters or more

$ CFG ['BlowFish_Secret'] = 'Secret-12345-09876_MY_PHRASE_777'; / You must fill in this for cookie Auth! /

Ctrl+o, Ctrl+X

The first mistake has gone. I get rid of the second warning.

  1. Created a temporary directory for phpmyadmin templates

    cd /usr/share/phpmyadmin
    mkdir tmp
    chown www-data:www-data tmp

  2. I open again in the browser http: // localhost/phpmyadmin

    • I introduce user name and password.

PHPMYADMIN update has been successfully carried out. There are no more errors or warnings.



Related publications