简体   繁体   English

更新 phpmyadmin (Ubuntu)。[如何?]

[英]Updating phpmyadmin (Ubuntu).[How?]

I'm new in programming and I have an old phpmyadmin (contains my training and jobs data).我是编程新手,我有一个旧的 phpmyadmin(包含我的培训和工作数据)。 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?如果我卸载了 phpmyadmin,我的数据会被删除吗?
thanks in advance提前致谢

Here is how to upgrade/downgrade on Ubuntu.以下是如何在 Ubuntu 上升级/降级。

Note : The following instruction only works if you previously correctly installed phpmyadmin with the command line and use APACHE as a web server注意:以下说明仅适用于您之前使用命令行正确安装了 phpmyadmin 并使用 APACHE 作为 Web 服务器的情况

I suppose that you already have a working phpmyadmin, but the version isn't the one you want.我想您已经有一个可以运行的 phpmyadmin,但该版本不是您想要的版本。 For instance Ubuntu is shipping the 4.6.x version witch does'nt work properly with php7.2.例如,Ubuntu 正在发布 4.6.x 版本的女巫不能与 php7.2 正常工作。

1 - check the version you want on : 1 - 检查你想要的版本:

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

2 - on your server 2 - 在您的服务器上

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注意:如果解压不起作用,请使用以下sudo apt-get install unzip安装它: sudo apt-get install unzip

3 - Check permissions 3 - 检查权限

Now you should be good.现在你应该好了。

The owner of /usr/share/phpmyadmin should be root:root on a default installation. /usr/share/phpmyadmin 的所有者在默认安装中应该是 root:root。 This should be fine but if you face some permissions issues, you can try to let Apache be the owner.这应该没问题,但是如果您遇到一些权限问题,您可以尝试让 Apache 成为所有者。

# 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您也可以重新启动Apache

sudo service apache2 reload

4 - Troubleshooting 4 - 故障排除

Note : according to your PHP version you might need to install extra librairies.注意:根据您的 PHP 版本,您可能需要安装额外的库。

Ex : error about missing mysqli and mysql extensions (adapt php version number)例如:关于缺少 mysqli 和 mysql 扩展的错误(调整 php 版本号)

sudo apt-get install php5.6-mysql

phpmyadmin is mysql client, so it will not affect your database if you uninstall phpmyadmin. phpmyadmin是mysql客户端,卸载phpmyadmin不会影响你的数据库。 I update phpmyadmin by using terminal commands:我使用终端命令更新 phpmyadmin:
First you have to add repository to get phpmyadmin :首先,您必须添加存储库以获取 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?使用 ubuntu 吗? i think it will be better if you ask it in ubuntu forum.我认为如果你在 ubuntu 论坛上问它会更好。
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).如果您发现从 ppa 获得的 phpmyadmin 版本不是最新版本,您可以在此处找到最新版本并手动安装(而不是从 repo)。
Downloaded phpmyadmin can be installed in /var/www/html/ or in your working directory ( public_html or something you've defined).下载的 phpmyadmin 可以安装在/var/www/html/或您的工作目录( public_html或您定义的内容)中。 Just extract the zip and move extracted folder to /var/www/html/ .只需解压缩 zip 并将解压缩的文件夹移动到/var/www/html/ And don't forget to change the permission of the phpmyadmin folder to 777 (it may not safe, but works fine).并且不要忘记将phpmyadmin文件夹的权限更改为777 (它可能不安全,但工作正常)。

Here is the how: extract downloaded file方法如下:提取下载的文件

unzip phpMyAdmin-4.6.6-all-languages.zip

move to /var/www/html/, you might need sudo.移至 /var/www/html/,您可能需要 sudo。
if you're not sudoer, move it into your working directory (eg public_html), and rename the folder to 'phpmyadmin'如果您不是 sudoer,请将其移动到您的工作目录(例如 public_html),并将文件夹重命名为“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 .然后您可以通过http://localhost/phpmyadmin访问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放在public_html ,您可能希望从/var/www/html创建一个符号链接,以便您可以像往常一样访问 phpmyadmin。

phpMyAdmin is only client for MySQL database, it doesn't contain your data. phpMyAdmin 只是 MySQL 数据库的客户端,它不包含您的数据。 It's all saved in database, so nothing will be deleted even if you delete phpMyAdmin.全部保存在数据库中,所以即使删除phpMyAdmin也不会删除任何内容。

To update phpMyAdmin from repository you can follow steps from this thread.要从存储库更新 phpMyAdmin,您可以按照此线程中的步骤操作。

1- check your phpmyadmin version from GUI. 1- 从 GUI 检查您的 phpmyadmin 版本。

2- Download Latest version of phpMyAdmin HERE 2- 在此处下载最新版本的 phpMyAdmin

Use the below command to download the latest version of phpMyAdmin into /opt or /usr/src directory使用以下命令将最新版本的 phpMyAdmin 下载到 /opt 或 /usr/src 目录中

# 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安装解压包注意事项: apt-get install unzip

# unzip phpMyAdmin-4.8.3-all-languages.zip

3- Find phpMyAdmin Installation Directory 3- 找到 phpMyAdmin 安装目录

Use the below command to search the phpMyAdmin Installation Directory on your system使用以下命令搜索系统上的 phpMyAdmin 安装目录

# /usr/share/phpMyAdmin

4- Remove/Delete phpMyAdmin content 4- 移除/删除 phpMyAdmin 内容

/usr/share/phpmyadmin is correct phpMyAdmin installation directory, Just Delete/Remove everything from that directory /usr/share/phpmyadmin 是正确的 phpMyAdmin 安装目录,只需从该目录中删除/删除所有内容

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

5- Move/Copy New phpMyAdmin content 5- 移动/复制新的 phpMyAdmin 内容

Use the below command to copy all the new phpMyAdmin content to /usr/share/phpmyadmin.使用以下命令将所有新的 phpMyAdmin 内容复制到 /usr/share/phpmyadmin。

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

6- Restart Apache, MySQL or MariaDB service. 6- 重启 Apache、MySQL 或 MariaDB 服务。

Start/Restart the service in SysVinit Systeme在 SysVinit Systeme 中启动/重启服务

# service restart httpd

# service restart mysql

Start/Restart the service in Systemd Systeme在 Systemd Systeme 中启动/重启服务

# systemctl restart httpd.service

# systemctl restart mariadb.service

7- Now Check New version of phpMyAdmin 7- 现在检查 phpMyAdmin 的新版本

Navigate your browser to http://localhost/phpmyadmin , Now you are using latest version 4.8.3 of phpMyAdmin.将浏览器导航到http://localhost/phpmyadmin ,现在您使用的是 phpMyAdmin 的最新版本 4.8.3。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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