Ubuntu18.04 配置php7.2+MySql5.7+Apache2.4+phpmyadmin

发布于 2019-03-28  1043 次阅读


[title]1.安装安装Ubuntu Server 18.04 TLS[/title]
过程略

[title]2.安装php7.2[/title]

root@lamp-server:~# sudo apt-get install php7.2

[title]3.安装Apache2apt-get install apache2[/title]

root@lamp-server:~# sudo systemctl start apache2

[title]4.安装mysql-server mysql-client libmysqlclient-dev[/title]

root@lamp-server:~# sudo apt-get install mysql-server mysql-client libmysqlclient-dev
root@lamp-server:~# sudo systemctl start mysql

[title]5.设置mysql 密码[/title]

root@lamp-server:~# sudo su
root@lamp-server:~# mysql
mysql> update mysql.user set authentication_string=PASSWORD('P@ssw0rd'), plugin='mysql_native_password' where user='root';
mysql> flush privileges;

[title]6.安装 phpmyadmin[/title]

root@lamp-server:~# sudo apt install phpmyadmin

根据安装提示设置phpmyadmin的数据库密码,填写好后就OK。
但是我们通常登录时用root,使用的是root 密码登录

root@lamp-server:~# ln -s /usr/share/phpmydmin /var/www/html/pma

[title]7.测试phpmyadmin[/title]

http://172.18.119.27/pma/index.php

[title]8.php7.2 与 phpmyadmin 4.6.6 不兼容[/title]

修改:

sudo vim /usr/share/phpmyadmin/libraries/sql.lib.php

613行

|| (count($analyzed_sql_results['select_expr'] == 1)

改为

|| ((count($analyzed_sql_results['select_expr']) == 1)
root@lamp-server:~# sudo systemctl restart apache2

推荐:手动升级phpMyadmin 4.6 to 4.8


一沙一世界,一花一天堂。君掌盛无边,刹那成永恒。