Manually upgrade phpMyAdmin

How to Manually Upgrade phpMyAdmin

Last updated on | 561 replies

Whether your repository is too slow to deliver the latest version of phpMyAdmin or you are having compatibility issues with your current version, in this article we will manually download and install the latest version of phpMyAdmin.

Introduction

This guide has been tested on Ubuntu 22.04 & 20.04 running PHP 8. It may also work for older configurations. If you have any issues, please let me know in the comments.

1. Back up phpMyAdmin

Firstly, if you followed this guide before, make sure to delete the backup directory you created.

sudo rm -rf /usr/share/phpmyadmin.bak

Back up your current phpMyAdmin folder by renaming it.

sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak

Create a new phpMyAdmin folder.

sudo mkdir /usr/share/phpmyadmin/

CD to directory.

cd /usr/share/phpmyadmin/

2. Download and Extract phpMyAdmin

phpMyAdmin 5.2.1 (released Feb 2023) requires PHP 7.2 or newer. To find out your PHP version in command line, run php -v. If you need to upgrade PHP, see guide: How to Upgrade from PHP 7.x to PHP 8 on Ubuntu.

  • For PHP 7.2 or newer, download phpMyAdmin 5.2.1
  • For PHP 7.1, download phpMyAdmin 5.1.4
  • For PHP 5.5 to PHP 7.4, download phpMyAdmin-4.9.11

Visit the phpMyAdmin download page and look for the .tar.gz URL and download it using wget. In this guide we are using version 5.2.1, released Feb 2023. If a later version is now available, make sure to change the commands below to match (and let me know in the comments so I can update the guide ๐Ÿ˜‰).

Download phpMyAdmin.

sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.tar.gz

Now extract.

sudo tar xzf phpMyAdmin-5.2.1-all-languages.tar.gz

Once extracted, list folder.

ls

You should see a new folder phpMyAdmin-5.2.1-all-languages

We want to move the contents of this folder to /usr/share/phpmyadmin

sudo mv phpMyAdmin-5.2.1-all-languages/* /usr/share/phpmyadmin

You can now log back into phpMyAdmin and check the current version. You may also see two errors:

3. Fixing phpMyAdmin Errors

3.1. “The configuration file needs a valid key for cookie encryption” error

You may see an error The configuration file needs a valid key for cookie encryption. A temporary key was automatically generated for you. Please refer to the documentation.

You should create a key unique to your phpMyAdmin install.

phpMyAdmin first loads /usr/share/phpmyadmin/libraries/config.default.php and then overrides those values with anything found in /usr/share/phpmyadmin/config.inc.php.

Create config.inc.php.

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

Your file should look something like below. Generate your own 32-character blowfish secret and paste it below.

/usr/share/phpmyadmin/config.inc.php
<?php
// use here a value of your choice 32 chars long
$cfg['blowfish_secret'] = 'PASTE__32__CHAR__BLOWFISH_SECRET';

$i=0;
$i++;
$cfg['Servers'][$i]['auth_type']     = 'cookie';

Save and exit (press CTRL + X, press Y and then press ENTER)

Log back into phpMyAdmin and check that the error is gone.

3.2. $cfg[‘TempDir’] (/usr/share/phpmyadmin/tmp/) is not accessible error

If you are seeing an error The $cfg[‘TempDir’] (/usr/share/phpmyadmin/tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.

You need to create this directory and make it writable.

sudo mkdir /usr/share/phpmyadmin/tmp && sudo chmod 777 /usr/share/phpmyadmin/tmp

Log back into phpMyAdmin and check that the error is gone.

4. Cleanup

You can now delete the tar.gz file and the empty folder.

sudo rm /usr/share/phpmyadmin/phpMyAdmin-5.2.1-all-languages.tar.gz
sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-5.2.1-all-languages

And if you’re certain your new phpMyAdmin install is working correctly you can delete the backup folder.

sudo rm -rf /usr/share/phpmyadmin.bak

Hurrah!

Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or ๐ŸŠ buy me a smoothie.

Comments (561)Forum replies (0)

No replies yet

Loading new replies...

561 replies

Leave a reply

Your email address will not be published. Required fields are marked *

  1. Hi, I think than better than giving 777 to the tmp folder, you could change the owner to the apache user (usually www-data) with something like:

    sudo chown www-data /usr/share/phpmyadmin/tmp/

    1. I had followed this guide and read your comment afterwards. I agree with you so now I want to change the permissions back to their original/default but do not know what those are? Could you tell me/do you know?

  2. Here’s a PHP script to facilitate the above steps.

    Please read through it and never run scripts blindly without understanding what they do.

  3. Followed your beautifully clear instructions, /usr/share/phpmyadmin directory contains 5.2.1, bak contains the old one.
    After reboot, to restart anything necessary, and refreshing the phpMyAdmin web page I still see the old version:
    “A newer version of phpMyAdmin is available and you should consider upgrading. The newest version is 5.2.1, released on 2023-02-08.”
    Is there another location where the old version might be running from?

    Raspberry Pi OS (updated) (Debian-based, like Ubuntu), PHP 7.3, Apache/2.4.54 (Raspbian)

  4. I followed all the instructions which are beautifully clear, and it all appeared to work – when I look in /usr/share/phpmyadmin I see 5.2.1, and all directories are dated 8/2/2023.
    But when I opened phpMyAdmin, I still see “A newer version of phpMyAdmin is available and you should consider upgrading. The newest version is 5.2.1, released on 2023-02-08.”
    I restarted apache2 and mysql but that made no difference, so rebooted the server. Reopened the phpMyAdmin webpage but still it shows 5.1.0

    I ran a find on phpmyadmin
    sudo find / -name phpmyadmin
    find: โ€˜/run/user/1000/gvfsโ€™: Permission denied
    /etc/phpmyadmin
    /usr/share/phpmyadmin
    /usr/share/phpmyadmin/vendor/phpmyadmin
    /usr/share/dbconfig-common/scripts/phpmyadmin
    /usr/share/dbconfig-common/data/phpmyadmin
    /usr/share/doc-base/phpmyadmin
    /usr/share/doc/phpmyadmin
    /usr/share/lintian/overrides/phpmyadmin
    /var/www/html/phpMyAdmin/vendor/phpmyadmin
    /var/lib/phpmyadmin
    /var/lib/mysql/phpmyadmin

    I see there’s a file themes.php in phpmyadmin.bak so I did a find on that to see if there’s another copy of the old version elsewhere where it’s being run from, but there’s only that one copy.

    It seems to be loading from phpmyadmin.bak, not phpmyadmin

    Any suggestions, please?
    Thanks

    Raspberry Pi running Pi OS, which is, like Ubuntu, a version of Debian, php 7.3.33, Apache/2.4.54 (Raspbian)

  5. Worked 100% with no fuss and no re-trying. Thank you a million times for this clear and concise contribution.

  6. FOR THEOSE WHO has the error “The phpMyAdmin configuration storage is not completely configured” and NOBODY here helped:

    ubuntu – log in console server root
    and type these comands one by one:

    mysql
    GRANT ALL PRIVILEGES ON *.* TO ‘you.user.witch.you.use.in.phpmyadmin.log.in.page’@’localhost’ WITH GRANT OPTION;
    FLUSH PRIVILEGES;

    DONE – it will give permission to user to create the missing tables for the user in cause!

  7. Good stuff!
    Instead of 777 for the tmp directory, I’d suggest:
    sudo chown root:www-data /usr/share/phpmyadmin/tmp
    sudo chmod g+rwxs /usr/share/phpmyadmin/tmp

    Assuming www-data is the apache system user, and root is the current owner, this adds apache as a the group and gives it permission to create and manage its own files there without giving access to everyone on the system.

  8. Hi,

    Upgrading worked, thanks for the nice how-to.

    Perhaps any idea how I can change my Server charset from cp1252 West European (latin1) to UTF-8 Unicode (utf8mb4)?

    Cheers!

    1. Try:

      sudo nano /etc/mysql/my.cnf

      Paste in

      [client]
      default-character-set=utf8mb4
      
      [mysql]
      default-character-set=utf8mb4
      
      [mysqld]
      collation-server = utf8mb4_unicode_520_ci

      Save and exit (press CTRL + X, press Y and then press ENTER)

      Restart MySQL

      sudo service mysql restart
  9. I’ve upgraded and within phpmyadmin it’s showing as 5.2 however when running dpkg -l phpmyadmin is says:

    ii phpmyadmin 4:4.6.6-5ubuntu0.5 all MySQL web administration tool

    any ideas?

    1. Well, this is why this article exists. The repositories often do not have the latest versions of packages such as phpMyAdmin, so instead we install it manually. In doing this, we bypass apt and dpkg is “dumb” to any version changes. Hope that makes sense?

  10. Hi, Bro

    Thanks for your great post! You are the tech God. ๐Ÿ˜€

    And hope you can keep going for sharing more great posts in future.

    I am your Fans.

    Best

  11. Hi,

    I am very grateful for this description. Everything works fine.
    Probably, I cannot count up to 32, because I always got the message ” The secret passphrase in configuration (blowfish_secret) is not the correct length. It should be 32 bytes long.”

    Found this entry after I had to realize that php 8.1.7 requires phpmyadmin version 5.2 and higher.

    Regards,
    Dietmar

  12. wow, Thanks so much. That tutorial not only walked me through the process of installing phpmyadmin but also anticipated error. Thanks so much.

  13. This webpage for upgrading phpmyadmin is great!! Thank you.
    I also encountered the same issue when installing v.5.2.0.
    “The configuration file now needs a secret Passphrase (blowfish_secret).
    CONFIG_DIR no longer exists in the vendor_config.php file.

    I have not tried what was documented here as mention below by Chris.
    https://docs.phpmyadmin.net/en/latest/setup.html#quick-install-1

    Also have this new warning: The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why.
    Or alternately go to ‘Operations’ tab of any database to set it up there.

    Otherwise, it seems to be working fine.
    Any updated suggestions would be great….and thanks again.

    1. Thanks for the link, Marty. I have updated the guide on the recommendations from phpMyAdmin.

      As for your storage error, I have never seen that before and cannot test for it. There’s plenty of comments about it over on Stackoverflow if your search. Good luck.

      1. Thanks for the quick response on this issue. Worked great.
        I’ll check into the other issue on Stackoverflow. Best regards.

  14. Hello! Just tried to install phpMyAdmin 5.2.0 and I have ‘The configuration file now needs a secret passphrase (blowfish_secret)’ error. There is no ‘CONFIG_DIR’ variable in vendor_config.php. What should I do?

  15. I don’t have any mention of CONFIG_DIR in the vendor_config.php file

    I’m using php 8.1.5 and phpMyAdmin 5.2.0

    Can someone tell me what the new procedure is?

  16. For 5.2.0 CONFIG_DIR is not used so amend the configFile line instead, eg:

    ‘configFile’ => ‘/etc/phpmyadmin/config.inc.php’,

  17. Taken from phpmyadmin/doc/html/setup.html#quick-install
    You may like to add this to your documentation.
    Aparently you have to create config.inc.php in directory that contain index.php:-

    <?php
    // use here a value of your choice at least 32 chars long
    $cfg['blowfish_secret'] = '1{dd0`<Q),5XP_:R9UK%%8\"EEcyH#{o';

    $i=0;
    $i++;
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    // if you insist on "root" having no password:
    // $cfg['Servers'][$i]['AllowNoPassword'] = true;

  18. Thank you! The best guide!
    Change to Raspberry Pi OS 64-Bit with:
    Apache2 –> PHP8.1 –> MariaDB –> phpMyAdmin5.1.3

  19. Best guide out there, painless upgrade when following your description!
    As requested, I let you know that phpmyadmin is at version 5.1.3 now. Thanks for updating your guide!
    And thanks for providing these instructions, much appreciated!

  20. This post has always worked flawlessly for me when upgrading. However, I just downloaded 5.2.0-rc1 and it appears that the contents of vendor_config.php have changed. For instance the lines containing ‘TEMP_DIR’ and ‘CONFIG_DIR’ are different and the instructions no longer work. You may want to update the post to include new instructions since the changes will likely be applicable to future official releases.

    1. Correct! There have been some fundamental changes in this new release. I have updated the guide. Let me know if it works ok.

  21. This tutorial worked perfectly for me! Thank you so much.
    Leaving a comment, hopefully it’ll help the recommendation of this post throughout the Internet ๐Ÿ˜€

    Have a nice one.

  22. What I get is a 404 error. I can see all the files are there so it looks like a permissions issue, had to run CHMOD, CHOWN and create a tmp folder. Works now.

  23. Thank you very much for your tutorial that helped me a lot. Upgrade from Ubuntu 18 to 20 make a mess, but is sorted

  24. Thank you:
    I’ve just followed the instructions and used the latest version 5.1.1 and all is now fixed
    I did have to make the changes in the vendor_config.php to remove the warnings.
    PRETTY_NAME=”Raspbian GNU/Linux 10 (buster)”
    NAME=”Raspbian GNU/Linux”
    VERSION_ID=”10″
    VERSION=”10 (buster)”
    VERSION_CODENAME=buster

  25. Work ! thank you

    ———————————————————————-
    2021 — CentOS 7 and Php 7.4 Phpmyadmin 5.1.1
    ———————————————————————–

    sudo mv /usr/share/phpMyAdmin/ /usr/share/phpMyAdmin.bak

    sudo mkdir /usr/share/phpMyAdmin/

    cd /usr/share/phpMyAdmin/

    sudo tar xzf phpMyAdmin-5.1.1-all-languages.tar.gz

    sudo mv phpMyAdmin-5.1.1-all-languages/* /usr/share/phpMyAdmin

    sudo mkdir /var/lib/phpMyAdmin/tmp/
    sudo chown -R apache:apache /var/lib/phpMyAdmin/tmp
    sudo chmod -R 0755 /var/lib/phpMyAdmin/tmp/

    sudo nano /usr/share/phpMyAdmin/libraries/vendor_config.php

    define(‘TEMP_DIR’, ‘/var/lib/phpMyAdmin/tmp/’);

    define(‘CONFIG_DIR’, ‘/etc/phpMyAdmin/’);

    Save

  26. Excellent article, Thank you.
    If anyone found some error after doing every step in this article, you may found a message like “The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why. Or alternately go to ‘Operations’ tab of any database to set it up there.”
    Don’t panic, first, you should log in as root and scroll down to found the message that I mentioned and then click find out why and click create a database for configuration like something like that, and waiting for creating some table, it shows OK, finally, you can use phpMyAdmin normally. ๐Ÿ™‚

  27. bro, you are really save my time.. running flawlesly, thanks a lot.. I was implement it on my dev and production server..

  28. Awesome instructions, thanks.
    I particulary like the way you give us both the exact syntax and a clear explanation about what we’re doing.

  29. You should also consider to delete the default setup UI, it is a security risk.
    Just delete the directory: /usr/share/phpmyadmin/setup/

  30. This is the first How-To I have followed to the letter that worked the first time in a long time! Thank you for the effort.

  31. That is a great tutorial. But in my case when trying to open phpMyAdmin, it gave me a Permission denier error. So I had to run chmod 777 /var/lib/php/session/ then it worked.

  32. error
    The $cfg[‘TempDir’] (/usr/share/phpmyadmin/tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.

  33. Great Tutorial ! I don’t know what exactly happened but after closely following the instructions to install phpmyadmin I get the infamous 4O4 ERROR – URL not found on this server. Every other thing worked as per the instructions.

  34. Hello, I have a question, I really don’t know if you can help me, but if you do, I would appreciate it too much! The problem is the following: I have a VPS, in it I put the Phpmyadmin, mysql, etc …, I also installed the OGP (Open Game Panel), the fact is that when I create the database of one of my server games, everything is fine, it connects well and everything, but when I enter the game and try to register, it does not let me, I get that the account “supposedly already exists”, but in reality it does not exist, a table must be created in the table ” users ” with the user’s data, but it is not like that, I get that error, if you could help me I would appreciate it, I know it does not have much to do with what you published, but I am new to this and I do not know how to fix it .

    Postscript: It is not the game, since the game is called “SAMP” (San Andreas MultiPlayer) and actually in other VPS if it works well, but not in mine, then the problem must be with MySQL or PhpMyAdmin, but I really don’t know.

  35. One problem with 5.0.2 was I had no tmp directory under /var/lib/phpMyAdmin (it is phpMyAdmin not phpmyadmin). Created the tmp directory, changed ownership as apache:apache, made sure it had write permissions. Had to restart httpd for these config changes. Then errors went away.
    When I set tmp pointer, site stopped working (did not exist – I did not confirm first).
    Centos7
    5.5.65-MariaDB – MariaDB Serve
    Apache/2.4.6 (CentOS) PHP/7.3.22
    phpMyAdmin: 5.0.2

  36. Great. I hate it when they keep updating shit so fast, and compatibility errors start occurring, but I love it when guys like you give us an simple fix.

  37. wow, just fantastic steps, every step was described, even how to save and exit editor in linus, Thank you

  38. This is one of the best support pages I have experienced in my entire coding life span. I am 80 years old, I started learning how to code 5 years ago and in my humble opinion it is not easy, however it becomes easier to understand each day I continue to learn. This particular page was extremely helpful with your detailed and specific instructions/guidelines. They (instructions/guidelines) were easy to understand and follow, I did not have to go to another page to get explanations for anything. THANKS, I really like your style.
    T.R.E.B.

  39. Unfortunately your tutorial seems to have made things worse, with an error coming up:

    Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.

    session_write_close(): write failed: No space left on device (28)

    session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/sessions)

    If anyone has any answers, then would be much appreciated!

  40. i always look at digitalocean for good tutorial for this kind of job. now i found another one.

    truly thanks

  41. Muchas Gracias el phpmyadmin me tenia sufriendo y no sabia porque era pero gracias a tu
    pagina lo pude soluciona un saludo esta muy completa la explicacion.

  42. Hola realice los camnios y todo funciono perfecto, pero Edite vendor_config.php y dejo de funcionar y ya no puedo hacer inicio en phpmyadmin.

    Que puedo hacer para corregir.

    gracias

  43. Thank you very much.

    This tutorial is very helpful with all the details and commands we need to fix the problem.

  44. Hello .. I am Using Google Cloud..I Just Updated Php Version to 7.3 and followed your process but after doing that when i try to log in phpmyadmin it says..PHP 7.1.3+ is required.
    Currently installed version is: 7.0.33-0+deb9u7….But When i check through SSH It says 7.3 ..Please Help what to do..

    1. You may have updated the CLI PHP version that runs in command line only. Ensure you have also updated PHP for Apache or Nginx.

      To find out which PHP version the web server is using, create a new PHP file in your document root called info.php with the following:

      <?php
      phpinfo();
      ?>

      Load that in the browser and it will report which PHP version you are using.

  45. This is perfect! But if you’re running NGINX or Apache2 and you assign these services to a user, you’ll need to change the ownership of /var/lib/phpmyadmin/tmp &amp;&amp; /var/lib/phpmyadmin/blowfish_secret.inc.php &amp;&amp; /var/lib/phpmyadmin/config.inc.php to your user.

    Where user == Your User Name

    sudo chown user.user /var/lib/phpmyadmin/tmp
    sudo chown root.user /var/lib/phpmyadmin/blowfish_secret.inc.php
    sudo chown root.user /var/lib/phpmyadmin/config.inc.php
  46. A soluรงรฃo mais simples e rรกpida que encontrei atรฉ agora. Parabรฉns.

    E, para quem se interessar e tiver o mesmo problema, utilizao Ubuntu 18.04 em WSL (Windows 10 Home), PHP 7.4, Apache2 e Mysql.

    Muito obrigado e sucesso!
    Receba um abraรงo deste brasileiro.
    Luiz Vidaum
    Sรฃo Paulo/Brasil

  47. Perfect tutorial. I have upgraded in 2 minutes. No issues at all. I didnt get that blowfish warning too.

  48. Uhll! I think I’m close! 90% of my bugs disappeard. The only issue (new one) is “Failed to read configuration file!”

    define('CONFIG_FILE', '/etc/phpmyadmin/');

    I was trying to find a solution before reaching you. The problem is that there is a message “This usually means there is a syntax error in it, please check any errors shown below.”, but the field bellow is empty. Any idea what could be? Thx in advance.

  49. Hi, after doing everything you told me to do, I still got the exact same two errors… can you help me?

  50. Hi sorry for this, everything works and I can clearly see the latest 5.0.2 version, but I have the issue that if I run “apt update” it tells me that my installed version is 4.6.6 and fails to upgrade to the proposed 4.9.5. Is there a way to fix my apt in a way that it will understand that my version is now 5.0.2? many thanks

    1. Yes, I have exactly the same issues here. After manually updating PMA to 5.0.4 I was surprised to see that it was downgraded to 4.6.6deb5ubuntu0.5 again.

  51. hello i have this error which is displayed at the bottom of my page how to fix it please
    $cfg[‘TempDir’] (/var/lib/phpmyadmin/temp/) is not accessible. phpMyAdmin is unable to cache models and therefore will be slow.

  52. Superb – you anticipated all the hiccups I would find. I never had to look anywhere else for once! lol

    Thanks mate.

  53. thanks alot, I was about to go back to selling drugs….. but then again it happens with every bump in the way

  54. I’ve installer Php FPM 7, 7.1 , 7.2, 7.3 but phpmyadmin still uses php5.6 so I can’t upgrad to v5.xx . How can I change the version of php that phpmyadmin uses? Thanks

  55. Thank you sir!

    If possible suggest to audience to wget to a different directory, maybe home but not /usr/share/phpmyadmin.

    Well done. I appreciate this!

  56. Thank you. Sorted out my Raspberry Pi install. Nice easy to follow instructions.

    Appreciated.

  57. Small correction is about caps.

    On CentOS, phpmyadmin = phpMyAdmin on all folders.

    sudo mkdir /var/lib/phpMyAdmin/tmp/
    sudo chown -R apache:apache /var/lib/phpMyAdmin/tmp
    sudo chmod -R 0755 /var/lib/phpMyAdmin/tmp/

    All working great

  58. Hi, I update to phpmyadmin-5.0.1 in centos 8, but the 2 errors doesn’t disappear… this dir /etc/phpmyadmin/ don’t exist and my server can’t create it..

    cd /var/lib/phpmyadmin/tmp/

    -bash: cd: /var/lib/phpmyadmin/tmp/: No such file or directory

    sudo mkdir /var/lib/phpmyadmin/tmp/

    mkdir: cannot create directory ‘/var/lib/phpmyadmin/tmp/’: No such file or directory

    what can I do?

    1. I think the default phpMyAdmin directories are different on CentOS. Try searching for the directories.

      find / -type d -name 'phpmyadmin'

      You may have to manually list some directories until you find /tmp/ and the install directory.

  59. Honestly, The Best Tutorial about Ubuntu I’ve seen before , Specially for beginners . Thanks for this beginner friendly How To .

  60. Thank you. Works great! And for the all lazy men as myself you can use something like this bash script for automatic upgading to latest version:

    mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
    mkdir /usr/share/phpmyadmin/
    cd /usr/share/phpmyadmin/
    wget -q https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
    tar xzf ./phpMyAdmin-latest-all-languages.tar.gz
    rm ./phpMyAdmin-latest-all-languages.tar.gz
    pma_dir=$(ls ./)
    mv ${pma_dir}/* /usr/share/phpmyadmin
    rm -rf ${pma_dir}
    sed -ri โ€œs/(.)TEMP_DIR(.)/define(โ€˜TEMP_DIRโ€™, โ€˜\/var\/lib\/phpmyadmin\/tmp\/โ€™)\;/gโ€
    
    1. sed -ri โ€œs/(.)TEMP_DIR(.)/define(โ€˜TEMP_DIRโ€™, โ€˜\/var\/lib\/phpmyadmin\/tmp\/โ€™)\;/gโ€
      -bash: syntax error near unexpected token `(‘

  61. Hey, that was an absolute piece of cake! Worked great exactly as following your instructions. I have my own server i performed these instructions on. Thanks so much.

  62. Awesome job. Many people would give a solution like this without the step-by-step commands required (since they’re mostly simple), but you went that extra mile and it makes things just that much easier. This method of upgrading phpmyadmin worked perfectly – thanks!

  63. Perfect!!!
    Concise!!!!
    Works Great The First Time!!!
    Didn’t cause any additional errors or issues!!!!!
    Thanks!!!!

  64. Wonderful. I clean case of “damn, wonder if anyone else has… google … working solution”.
    Extra good to cover those possible errors and explain them. Saved me time and was educating too. Thanks!

  65. Peope were looking for this solution on other websites, a lot of wrong or temporary answers that leads to other errors, but this article… Awesome, thanks!

  66. Glad i made a backup.
    the new phpmyadmin is only giving me a white screen (even tried copying the config.sample.inc.php did not help)
    so change the dir to phpmyadmin.new and renamed the backup folder back to phpmyadmin
    but with the old one i also had a blowfish error
    this define(‘CONFIG_DIR’, ‘/etc/phpmyadmin/’); is giving an error 500 when changed in the vendor config file

  67. Thanks for this.
    Do you also have a solution where, once logged out, you can’t immidiately log-in again? I have to wait some time like an hour or so. I can’t find a good solution for that.

    Thanks!

  68. This was excellent – clearly written and bang up to date and all worked smoothly and well. Thank you so much!

  69. THANK YOU!! I have seen and tried to follow so many TUT’s, and too often they’re missing some final step, or outdated, or just not helpful. Within minutes my annoying MYSQL server has morphed into an error free and comfortable environment in which we can work.

    Really, excellent job!

  70. I encountered multiple errors after installing the default PhpMyAdmin version 4.6.6.deb5 that came with my Ubuntu 18.04 distribution. Your guide solved them all in one fell swoop. Excellent instructions and many thanks!

  71. It would have been absolutely possible to figure that out, but this fine turn-by-turn manual sped up the whole operation in the most pleasant way.

    T H A N K _ Y O U very much

  72. How to automate this on a simple script:

    $ nano phpmyadmin_update.sh

    echo "Backing up"
    mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
    
    echo "Getting lastest PHPMyAdmin version..."
    mkdir /usr/share/phpmyadmin/
    cd /usr/share/phpmyadmin/
    wget https://files.phpmyadmin.net/phpMyAdmin/4.9.0.1/phpMyAdmin-4.9.0.1-all-languages.tar.gz
    tar xzf phpMyAdmin-4.9.0.1-all-languages.tar.gz
    mv phpMyAdmin-4.9.0.1-all-languages/* /usr/share/phpmyadmin
    
    echo "Updating vendor_config"
    sed -i -r "s/('TEMP_DIR'\s*,)[^\)]*/\1 '\/var\/lib\/phpmyadmin\/tmp\/'/" /usr/share/phpmyadmin/libraries/vendor_config.php
    sed -i -r "s/('CONFIG_DIR'\s*,)[^\)]*/\1 '\/etc\/phpmyadmin\/'/" /usr/share/phpmyadmin/libraries/vendor_config.php
    
    echo "Cleaning up..."
    rm /usr/share/phpmyadmin/phpMyAdmin-4.9.0.1-all-languages.tar.gz
    rm -rf /usr/share/phpmyadmin/phpMyAdmin-4.9.0.1-all-languages
    rm -rf /usr/share/phpmyadmin.bak
    
    echo "Done!"
    echo
    1. For future reference, this is the updated script to download the last stable version of PHPMyAdmin:

      `echo
      echo “Backing up”
      mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak

      echo “Getting lastest PHPMyAdmin version…”
      mkdir -p /usr/share/phpmyadmin/
      cd /usr/share/phpmyadmin/
      wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
      tar xzf phpMyAdmin-latest-all-languages.tar.gz
      mv phpMyAdmin-/ /usr/share/phpmyadmin

      echo “Updating vendor_config”
      sed -i -r “s/(‘TEMP_DIR’\s,)[^)]/\1 ‘\/var\/lib\/phpmyadmin\/tmp\/’/” /usr/share/phpmyadmin/libraries/vendor_config.php
      sed -i -r “s/(‘CONFIG_DIR’\s,)[^)]/\1 ‘\/etc\/phpmyadmin\/’/” /usr/share/phpmyadmin/libraries/vendor_config.php

      echo “Cleaning up…”
      rm /usr/share/phpmyadmin/phpMyAdmin-latest-all-languages.tar.gz
      rm -rf /usr/share/phpmyadmin/phpMyAdmin-*
      rm -rf /usr/share/phpmyadmin.bak

      echo “Done!”
      echo
      `

  73. It didn’t work for me.
    Getting this work
    The $cfg[‘TempDir’] (./tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.

    1. This was happening to me too. I figured out it was a permissions problem. Here’s what solved it for me, use at your own risk (make sure not to include the $, it just shows the line is a command):

      $ cd /var/lib/phpmyadmin
      $ sudo chmod 775 tmp

  74. Perfect solution! Thanks! You might mention that, for Steps 2 and 4, the substring “all-languages” can be replaced with “english” in any command with that substring. The installation will then be a bit lighter, without the several MB of language files that are not needed when it’s known that only the English interface will be used.

  75. works perfectly on ubuntu 18.10.
    It seems that the phpmyadmin package on ubuntu isn’t tested before it released on apt.
    Yet another reason for me to move to Arch..

  76. Worked great! For some reason the copy past of the wget command did not work. I had to copy the URL from the website to download it. Same version you used though.

  77. Todo el tutorial ha funcionado muy bien ; pero tengo este mensaje:
    El almacenamiento de la configuraciรณn de phpMyAdmin ha sido desactivado.

  78. Very well, for my part, step 3 is not to do it is she who created the problems. so I cancel the 3.

    Ubunut Budgi 18.04.2 LTS

  79. Just for future visitors, to me it said newer version is 4.8.5 at current date.
    I did the same operations using 4.8.5 instead of 4.8.4 and it worked like a charm.
    Thanks for your help really!

  80. The best guide. I like the step by step as I’m noob in this server setting.

    My PHPMyAdmin is working now! Yeay! Thanks a lot!

  81. Accurate, simple and straight to the point. This is how every guide should be done. A very good job, mate! Thanks a lot!

  82. Nice guide!
    thanks for work.

    i hav got a warning after proccess this guide:
    ” Auf das $cfg[‘TempDir’] (./var/lib/phpmyadmin/tmp/) kann nicht zugegriffen werden.”
    => access denied.
    But i hav chown usr “www-data” & grp “www-data”.

  83. Worked like a champ. Excellent directions. This is Jan 1, 2019 and they still haven’t updated the repositories! Thanks for putting this together.

  84. Hello. This worked perfectly. Thank you for posting this, it’s the only real answer to this that I’ve been able to find.

  85. Thx worked nicely but is still get :
    The secret passphrase in configuration (blowfish_secret) is too short.
    Any tips?

    1. You probably missed the second edit :

      where he changes:
      define(‘CONFIG_DIR’, ‘ ‘);

      to:
      define(‘CONFIG_DIR’, ‘/etc/phpmyadmin/’);

  86. Clear, concise & accurate instructions.
    Great use of the command line and a ‘workflow’ process.
    And it worked ๐Ÿ™‚

  87. I did reinstall mysql and phpmyadmin multiple times in my raspberry pi ubuntu 18.04 server. phpmyadmin still had issues, but this manual totally helped. Many thanks

  88. After a few months of aggravating error messages you solved the problem! This worked just as you said and is wonderful!!!!!! Can’t thank you enough.

  89. hello,
    please help, i have mysql 8, php 7.2.7
    i installed phpmyadmin 4.6.6 and i had this errors, so i upgraded to 4.8.3 like you did but the errors still exists.
    please help

    The phpMyAd*min configuration storage is not completely configured,
    some extended features have been deactivated. Find out why. Or
    alternately go to ‘Operations’ tab of any database to set it up
    there. Open new phpMyAdmin window.
    mysqli_real_connect(): (HY000/1045): Access denied for user
    ‘phpmyadmin’@’localhost’ (using password: YES).
    Connection for controluser as defined in your configuration failed.*

  90. Thanks, excellent. Just a problem : the automatically generated blowfish secret phrase was too short : 24 chars, yet 32 needed. Modified in var/lib/phpmyadmin/blowfish_secret.inc.php (Raspbian)

  91. I have read tens of guides for Linux and no one was so simple and useful. I’d want to all guides was like this. Thank you.
    (sorry for my English, i’m not a native speaker)

  92. Thank you, i really appreciate your tutorial. The errors have been bugging me for a while, now all is fixed. Best regards and keep up the good work.

  93. Within the created DIR "/usr/share/phpmyadmin" is a file calles “config.sample.inc.php”.
    Open it, add a 32char alphanumeric string as value of “cfg[blowfish_secret]” and safe it as “config.inc.php”.

    While in the editing of

    "/usr/share/phpmyadmin/libraries/vendor_config.php"

    DO NOT replace

    "define('CONFIG_DIR', '');" by "define('CONFIG_DIR', '/etc/phpmyadmin/');".

    Instead take the path to the just altered “config.inc.php”. Take care, (maybe) because of the updating-process, there are minimum 2 other “config.inc.php” on your system under
    1) “/var/lib/phpmyadmin” (is empty)
    2) “/etc/phpmyadmin/” which will load the “blowfish”-file from “/var/lib/phpmyadmin”.

    In my case it was just possible to satisfy the error-message when pointing to “/usr/share/phpmyadmin/config.inc.php” with filled “blowfish_secret” as “CONFIG_DIR”.

    Finally, thank you very much for this guide.

  94. Hello,

    It was working till yesterday, Now i cant find config.inc.php and setting up blowfish_secret in this blog

    1. There is an easier method to get rid of that error. Open /usr/share/phpmyadmin/libraries/vendor_config.php, search for CONFIG_DIR and change it to:

      define('CONFIG_DIR', '/etc/phpmyadmin/');

  95. A quicker fix for the blowfish_secret :

    sudo nano /usr/share/phpmyadmin/libraries/vendor_config.php

    Press CTRL + W and search for CONFIG_DIR

    Change line to:
    define(‘CONFIG_DIR’, ‘/etc/phpmyadmin/’);

  96. Wonderful straight forward, easy to follow write up. Very well done. And most importantly, thank you for posting this tip to fix this issue for Ubuntu 18.04 users! (Not that it matters as it’s the same Ubuntu as in pure Linux, but implemented this fix in Windows Subsystem for Linux – Ubuntu 18.04)

    1. All I can recommend is that you restore your backup.

      sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.del

      sudo mv /usr/share/phpmyadmin.bak/ /usr/share/phpmyadmin

      Check that phpMyAdmin is working again.

  97. Yo realice todos los pasos pero me dejo un warning que dice
    El archivo de configuraciรณn ahora necesita una frase secreta (blowfish_secret).

    1. Buscando como arreglaro, edite el archivo config.default.php y en la linea $cfg[‘blowfish_secret’]=’ColocarValorAleatorio’

      QUEDANDO DE ESTA FORMA
      $cfg[‘blowfish_secret’] = ‘a0sfo49nadf89fa3s8f789sf78asb7p1587balz’

      segun esto se tiene que colocar un valor aleatorio, no se si sea correcto esto, sin embargo a mi me funciono.

      NOTA: para buscar la ubicacion del archivo
      sudo find / -name config.default.php