简体   繁体   中英

Updating phpmyadmin (Ubuntu).[How?]

I'm new in programming and I have an old phpmyadmin (contains my training and jobs data). I want update it to updated version and I want my data safe while updating it. Is there any way to do it by running any commands on terminal? Is my data erased if I unistalled phpmyadmin?
thanks in advance

Here is how to upgrade/downgrade on Ubuntu.

Note : The following instruction only works if you previously correctly installed phpmyadmin with the command line and use APACHE as a web server

I suppose that you already have a working phpmyadmin, but the version isn't the one you want. For instance Ubuntu is shipping the 4.6.x version witch does'nt work properly with php7.2.

1 - check the version you want on :

https://www.phpmyadmin.net/files/

2 - on your server

cd /usr/share/
rm -rf phpmyadmin

then adapt this line with correct version number

wget https://files.phpmyadmin.net/phpMyAdmin/4.8.0/phpMyAdmin-4.8.0-all-languages.zip
unzip phpMyAdmin-4.8.0-all-languages.zip
rm phpMyAdmin-4.8.0-all-languages.zip
mv phpMyAdmin-4.8.0-all-languages phpmyadmin

Note : If unzip don't work, install it with : sudo apt-get install unzip

3 - Check permissions

Now you should be good.

The owner of /usr/share/phpmyadmin should be root:root on a default installation. This should be fine but if you face some permissions issues, you can try to let Apache be the owner.

# only if you have permissions issues
chown -R www-data:www-data /usr/share/phpmyadmin
chmod -R 755 /usr/share/phpmyadmin

Also you can restart Apache

sudo service apache2 reload

4 - Troubleshooting

Note : according to your PHP version you might need to install extra librairies.

Ex : error about missing mysqli and mysql extensions (adapt php version number)

sudo apt-get install php5.6-mysql

phpmyadmin is mysql client, so it will not affect your database if you uninstall phpmyadmin. I update phpmyadmin by using terminal commands:
First you have to add repository to get phpmyadmin :

sudo add-apt-repository ppa:nijel/phpmyadmin;

and then update it to get the latest version of software in repositories :

sudo apt-get update;

after that, you can get it (install, you need to uninstall the older version first if you have) :

sudo apt-get install phpmyadmin;

Oh, make sure you are connected to the internet
Using ubuntu? i think it will be better if you ask it in ubuntu forum.
may it helps
------ UPDATE -------
If you find the phpmyadmin version you get from ppa is not the latest one, you can find the latest version here and install it manually (not from repo).
Downloaded phpmyadmin can be installed in /var/www/html/ or in your working directory ( public_html or something you've defined). Just extract the zip and move extracted folder to /var/www/html/ . And don't forget to change the permission of the phpmyadmin folder to 777 (it may not safe, but works fine).

Here is the how: extract downloaded file

unzip phpMyAdmin-4.6.6-all-languages.zip

move to /var/www/html/, you might need sudo.
if you're not sudoer, move it into your working directory (eg public_html), and rename the folder to 'phpmyadmin'

sudo mv phpMyAdmin-4.6.6-all-languages /var/www/html/phpmyadmin

change the permission

sudo chmod 777 -R /var/www/html/phpmyadmin

and then you can access phpmyadmin via http://localhost/phpmyadmin .

If you put the phpmyadmin in public_html , you might want to create a symlink into it from /var/www/html , so you can access phpmyadmin as usual.

phpMyAdmin is only client for MySQL database, it doesn't contain your data. It's all saved in database, so nothing will be deleted even if you delete phpMyAdmin.

To update phpMyAdmin from repository you can follow steps from this thread.

1- check your phpmyadmin version from GUI.

2- Download Latest version of phpMyAdmin HERE

Use the below command to download the latest version of phpMyAdmin into /opt or /usr/src directory

# wget https://files.phpmyadmin.net/phpMyAdmin/4.8.3/phpMyAdmin-4.8.3-all-languages.zip

Notes to install unzip package: apt-get install unzip

# unzip phpMyAdmin-4.8.3-all-languages.zip

3- Find phpMyAdmin Installation Directory

Use the below command to search the phpMyAdmin Installation Directory on your system

# /usr/share/phpMyAdmin

4- Remove/Delete phpMyAdmin content

/usr/share/phpmyadmin is correct phpMyAdmin installation directory, Just Delete/Remove everything from that directory

# cd /usr/share/phpMyAdmin/
# rm -Rf *

5- Move/Copy New phpMyAdmin content

Use the below command to copy all the new phpMyAdmin content to /usr/share/phpmyadmin.

# cd /opt/phpMyAdmin-4.8.3-all-languages
# mv * /usr/share/phpMyAdmin/

6- Restart Apache, MySQL or MariaDB service.

Start/Restart the service in SysVinit Systeme

# service restart httpd

# service restart mysql

Start/Restart the service in Systemd Systeme

# systemctl restart httpd.service

# systemctl restart mariadb.service

7- Now Check New version of phpMyAdmin

Navigate your browser to http://localhost/phpmyadmin , Now you are using latest version 4.8.3 of phpMyAdmin.

Reference

sudo su
cd /usr/share/
rm -rf phpmyadmin
wget https://files.phpmyadmin.net/phpMyAdmin/4.8.4/phpMyAdmin-4.8.4-all-languages.zip
unzip phpMyAdmin-4.8.4-all-languages.zip
mv phpMyAdmin-4.8.4-all-languages phpmyadmin
chown -R www-data:www-data /usr/share/phpmyadmin
chmod -R 755 /usr/share/phpmyadmin
sudo service apache2 reload

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM