最新消息:XAMPP默认安装之后是很不安全的,我们只需要点击左方菜单的 "安全"选项,按照向导操作即可完成安全设置。

XAMPP新闻_Linux环境安装phpMyadmin

XAMPP新闻 admin 944浏览 0评论
phpMyAdmin简介

phpMyAdmin是一个以PHP为基础,以Web为基础的架构在网站主机上的MySQL的数据库管理工具,让管理者可用Web接口管理MySQL数据库。借用Web接口可以成为一个简易方式输入繁杂SQL语法的更好的途径,尤其是要处理大量资料的汇入和汇出更方便。其中一个更大的优势在于依靠phpMyAdmin跟其他PHP程序一样在网页服务器上执行,但是您可以在任何地方使用这些程序产生的HTML页面,也就是于之上管理MySQL数据库,方便的建立,修改,删除数据库和数据表。也可借由phpMyAdmin建立常用的PHP语法,方便编写网页时所需要的sql语法正确性。

phpMyAdmin是一个非常受欢迎的基于web的MySQL数据库管理工具。它能够创建和删除数据库,创建/删除/修改表格,删除/编辑/添加副本,执行SQL脚本等。

phpMyAdmin安装

官网地址:https://www.phpmyadmin.net/

下载地址:https://www.phpmyadmin.net/downloads/

进入之后有下载按钮,点击导航栏的下载链接,进入下载界面,这里下载最新版的5.0.2

PHP版本:7.1及以上

MySQL版本:5.5及以上

AAA0088

1,下载phpMyAdmin

[root @ localhost〜]#wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.tar.gz

2,解压phpMyAdmin

[root @ localhost〜]#tar xf phpMyAdmin-5.0.2-all-languages.tar.gz

3,拷贝到访问目录下面(根据自身目录配置)

[root @ localhost〜]#mv phpMyAdmin-5.0.2-all-languages / usr / local / nginx / html / phpMyAdmin

4,修改phpMyAdmin配置文件

[root @ localhost〜]#cd / usr / local / nginx / html / phpMyAdmin

[root @ localhost phpMyAdmin]#cp config.sample.inc.php config.inc.php

[root @ localhost phpMyAdmin]#vim config.inc.php

找到$ cfg [‘blowfish_secret’]配置项,后面替换为空,这里我们可以随便设置一个复杂的字符串,用于加密使用:

32位字符串:PTOb45P2yyV * XXEdXQsKhA1VtFKurcHG

AAA00088

然后$ cfg [‘Servers’] [$ i] [‘auth_type’]这一部分为cookie,表示每次都要登录,我们不用修改,这样比较安全,然后$ cfg [‘Servers’] [$ i ] [‘host’] =’127.0.0.1′;这里建议设置成Mysql的IP地址(因为这里使用的数据库在本地),则无论是本地还是远程只要MySQL授权都没有问题,一定要注意,建议使用IP地址。

/ *验证类型* /

$ cfg [‘Servers’] [$ i] [‘auth_type’] =’cookie’;

/ *服务器参数* /

$ cfg [‘Servers’] [$ i] [‘host’] =’127.0.0.1′;

$ cfg [‘Servers’] [$ i] [‘compress’] = false;

$ cfg [‘Servers’] [$ i] [‘AllowNoPassword’] = false;

保存并退出。

5,创建缓存模板文件目录

[root @ localhost phpMyAdmin]#mkdir tmp

[root @ localhost phpMyAdmin]#chown -R www.www / usr / local / nginx / html / phpMyAdmin

6,编辑Nginx配置文件(根据自身配置)

[root @ localhost phpMyAdmin]#vim /usr/local/nginx/conf/nginx.conf

#配置内容如下

  1. 服务器{

  2. 80 ;

  3. server_name localhost ;

  4. 位置/ {

  5. 根html / phpMyAdmin ;

  6. 指标指标php索引html索引htm ;

  7. }

  8. 位置〜* \ .php $ {

  9. 根html / phpMyAdmin ;

  10. fastcgi_connect_timeout 300s ;

  11. fastcgi_send_timeout 300s ;

  12. fastcgi_read_timeout 300s ;

  13. fastcgi_buffer_size 64k ;

  14. fastcgi_buffers 4 64k ;

  15. fastcgi_busy_buffers_size 128k ;

  16. fastcgi_temp_file_write_size 256k ;

  17. fastcgi_pass 127.0 0.1 9000

  18. fastcgi_index索引php ;

  19. fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name ;

  20. 包括fastcgi_params ;

  21. }

  22. }


7,启动phpMyAdmin(使用的LNMP环境)

[root @ localhost phpMyAdmin]#nginx -t

nginx:配置文件/usr/local/nginx/conf/nginx.conf语法正常

nginx:配置文件/usr/local/nginx/conf/nginx.conf测试成功

[root @ localhost phpMyAdmin]#nginx -s重新加载

8,访问phpMyAdmin

浏览器访问服务器IP +端口,如下图

AAA000088

9,登录phpMyAdmin,输入用户名和密码,如下图

AAA0000088

10,激活高级功能完全设置

在phpMyAdmin的sql目录下有个create_tables.sql文件。传到本地计算机等待上传

[root @ localhost phpMyAdmin]#cd sql

[root @ localhost sql]#ll

总共28

-rw-r–r– 1 www www 10948 Mar 21 12:17 create_tables.sql

-rw-r–r– 1 www www 1665 Mar 21 12:17 upgrade_column_info_4_3_0 + .sql

-rw-r–r– 1 www www 671 3月21日12:17 upgrade_tables_4_7_0 + .sql

-rw-r–r– 1 www www 5691 Mar 21 12:17 upgrade_tables_mysql_4_1_2 + .sql

11,引入create_tables.sql文件

AAA00000088

引入成功会生成phpmyadmin数据库。

12,Mysql授权

进入Mysql控制台

mysql>将phpmyadmin。*上的所有权限授予由’12345678’标识的admin@’127.0.0.1′;

查询正常,影响0行,1警告(0.01秒)

mysql>刷新权限;

查询正常,受影响的0行(0.01秒)

AAA000000088

13,修改config.inc.php文件

[root @ localhost sql]#cd ..

[root @ localhost phpMyAdmin]#vim config.inc.php

  1. / *用户曾经使用存储操作* /

  2. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘controlhost’ ] = ‘127.0.0.1’ ;

  3. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘controlport’ ] = ‘3306’ ;

  4. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘controluser’ ] = ‘admin’ ;

  5. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘controlpass’ ] = ‘12345678’ ;

  6.  

  7. / *存储数据库和表* /

  8. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘pmadb’ ] = ‘phpmyadmin’ ;

  9. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘bookmarktable’ ] = ‘pma__bookmark’ ;

  10. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘relation’ ] = ‘pma__relation’ ;

  11. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘table_info’ ] = ‘pma__table_info’ ;

  12. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘table_coords’ ] = ‘pma__table_coords’ ;

  13. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘pdf_pages’ ] = ‘pma__pdf_pages’ ;

  14. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘column_info’ ] = ‘pma__column_info’ ;

  15. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘history’ ] = ‘pma__history’ ;

  16. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘table_uiprefs’ ] = ‘pma__table_uiprefs’ ;

  17. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘tracking’ ] = ‘pma__tracking’ ;

  18. $ cfg [ ‘服务器’ ] [ $ i ] [ ‘userconfig’ ] = ‘pma__userconfig’ ;

  19. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘recent’ ] = ‘pma__recent’ ;

  20. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘favorite’ ] = ‘pma__favorite’ ;

  21. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘users’ ] = ‘pma__users’ ;

  22. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘usergroups’ ] = ‘pma__usergroups’ ;

  23. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘navigationhiding’ ] = ‘pma__navigationhiding’ ;

  24. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘savedsearches’ ] = ‘pma__savedsearches’ ;

  25. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘central_columns’ ] = ‘pma__central_columns’ ;

  26. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘designer_settings’ ] = ‘pma__designer_settings’ ;

  27. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘export_templates’ ] = ‘pma__export_templates’ ;

14,重启phpmyadmin

[root @ localhost phpMyAdmin]#nginx -s重新加载

15,访问phpMyAdmin

浏览器访问服务器IP +端口,如下图

AAA0000000088

phpMyAdmin简介

phpMyAdmin是一个以PHP为基础,以Web为基础的架构在网站主机上的MySQL的数据库管理工具,让管理者可用Web接口管理MySQL数据库。借用Web接口可以成为一个简易方式输入繁杂SQL语法的更好的途径,尤其是要处理大量资料的汇入和汇出更方便。其中一个更大的优势在于依靠phpMyAdmin跟其他PHP程序一样在网页服务器上执行,但是您可以在任何地方使用这些程序产生的HTML页面,也就是于之上管理MySQL数据库,方便的建立,修改,删除数据库和数据表。也可借由phpMyAdmin建立常用的PHP语法,方便编写网页时所需要的sql语法正确性。

phpMyAdmin是一个非常受欢迎的基于web的MySQL数据库管理工具。它能够创建和删除数据库,创建/删除/修改表格,删除/编辑/添加副本,执行SQL脚本等。

phpMyAdmin安装

官网地址:https://www.phpmyadmin.net/

下载地址:https://www.phpmyadmin.net/downloads/

进入之后有下载按钮,点击导航栏的下载链接,进入下载界面,这里下载最新版的5.0.2

PHP版本:7.1及以上

MySQL版本:5.5及以上

1,下载phpMyAdmin

[root @ localhost〜]#wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.tar.gz

2,解压phpMyAdmin

[root @ localhost〜]#tar xf phpMyAdmin-5.0.2-all-languages.tar.gz

3,拷贝到访问目录下面(根据自身目录配置)

[root @ localhost〜]#mv phpMyAdmin-5.0.2-all-languages / usr / local / nginx / html / phpMyAdmin

4,修改phpMyAdmin配置文件

[root @ localhost〜]#cd / usr / local / nginx / html / phpMyAdmin

[root @ localhost phpMyAdmin]#cp config.sample.inc.php config.inc.php

[root @ localhost phpMyAdmin]#vim config.inc.php

找到$ cfg [‘blowfish_secret’]配置项,后面替换为空,这里我们可以随便设置一个复杂的字符串,用于加密使用:

32位字符串:PTOb45P2yyV * XXEdXQsKhA1VtFKurcHG

然后$ cfg [‘Servers’] [$ i] [‘auth_type’]这一部分为cookie,表示每次都要登录,我们不用修改,这样比较安全,然后$ cfg [‘Servers’] [$ i ] [‘host’] =’127.0.0.1′;这里建议设置成Mysql的IP地址(因为这里使用的数据库在本地),则无论是本地还是远程只要MySQL授权都没有问题,一定要注意,建议使用IP地址。

/ *验证类型* /

$ cfg [‘Servers’] [$ i] [‘auth_type’] =’cookie’;

/ *服务器参数* /

$ cfg [‘Servers’] [$ i] [‘host’] =’127.0.0.1′;

$ cfg [‘Servers’] [$ i] [‘compress’] = false;

$ cfg [‘Servers’] [$ i] [‘AllowNoPassword’] = false;

保存并退出。

5,创建缓存模板文件目录

[root @ localhost phpMyAdmin]#mkdir tmp

[root @ localhost phpMyAdmin]#chown -R www.www / usr / local / nginx / html / phpMyAdmin

6,编辑Nginx配置文件(根据自身配置)

[root @ localhost phpMyAdmin]#vim /usr/local/nginx/conf/nginx.conf

#配置内容如下

  1. 服务器{

  2. 80 ;

  3. server_name localhost ;

  4. 位置/ {

  5. 根html / phpMyAdmin ;

  6. 指标指标php索引html索引htm ;

  7. }

  8. 位置〜* \ .php $ {

  9. 根html / phpMyAdmin ;

  10. fastcgi_connect_timeout 300s ;

  11. fastcgi_send_timeout 300s ;

  12. fastcgi_read_timeout 300s ;

  13. fastcgi_buffer_size 64k ;

  14. fastcgi_buffers 4 64k ;

  15. fastcgi_busy_buffers_size 128k ;

  16. fastcgi_temp_file_write_size 256k ;

  17. fastcgi_pass 127.0 0.1 9000

  18. fastcgi_index索引php ;

  19. fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name ;

  20. 包括fastcgi_params ;

  21. }

  22. }


7,启动phpMyAdmin(使用的LNMP环境)

[root @ localhost phpMyAdmin]#nginx -t

nginx:配置文件/usr/local/nginx/conf/nginx.conf语法正常

nginx:配置文件/usr/local/nginx/conf/nginx.conf测试成功

[root @ localhost phpMyAdmin]#nginx -s重新加载

8,访问phpMyAdmin

浏览器访问服务器IP +端口,如下图

9,登录phpMyAdmin,输入用户名和密码,如下图

10,激活高级功能完全设置

在phpMyAdmin的sql目录下有个create_tables.sql文件。传到本地计算机等待上传

[root @ localhost phpMyAdmin]#cd sql

[root @ localhost sql]#ll

总共28

-rw-r–r– 1 www www 10948 Mar 21 12:17 create_tables.sql

-rw-r–r– 1 www www 1665 Mar 21 12:17 upgrade_column_info_4_3_0 + .sql

-rw-r–r– 1 www www 671 3月21日12:17 upgrade_tables_4_7_0 + .sql

-rw-r–r– 1 www www 5691 Mar 21 12:17 upgrade_tables_mysql_4_1_2 + .sql

11,引入create_tables.sql文件

引入成功会生成phpmyadmin数据库。

12,Mysql授权

进入Mysql控制台

mysql>将phpmyadmin。*上的所有权限授予由’12345678’标识的admin@’127.0.0.1′;

查询正常,影响0行,1警告(0.01秒)

mysql>刷新权限;

查询正常,受影响的0行(0.01秒)

13,修改config.inc.php文件

[root @ localhost sql]#cd ..

[root @ localhost phpMyAdmin]#vim config.inc.php

  1. / *用户曾经使用存储操作* /

  2. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘controlhost’ ] = ‘127.0.0.1’ ;

  3. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘controlport’ ] = ‘3306’ ;

  4. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘controluser’ ] = ‘admin’ ;

  5. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘controlpass’ ] = ‘12345678’ ;

  6.  

  7. / *存储数据库和表* /

  8. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘pmadb’ ] = ‘phpmyadmin’ ;

  9. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘bookmarktable’ ] = ‘pma__bookmark’ ;

  10. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘relation’ ] = ‘pma__relation’ ;

  11. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘table_info’ ] = ‘pma__table_info’ ;

  12. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘table_coords’ ] = ‘pma__table_coords’ ;

  13. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘pdf_pages’ ] = ‘pma__pdf_pages’ ;

  14. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘column_info’ ] = ‘pma__column_info’ ;

  15. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘history’ ] = ‘pma__history’ ;

  16. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘table_uiprefs’ ] = ‘pma__table_uiprefs’ ;

  17. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘tracking’ ] = ‘pma__tracking’ ;

  18. $ cfg [ ‘服务器’ ] [ $ i ] [ ‘userconfig’ ] = ‘pma__userconfig’ ;

  19. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘recent’ ] = ‘pma__recent’ ;

  20. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘favorite’ ] = ‘pma__favorite’ ;

  21. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘users’ ] = ‘pma__users’ ;

  22. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘usergroups’ ] = ‘pma__usergroups’ ;

  23. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘navigationhiding’ ] = ‘pma__navigationhiding’ ;

  24. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘savedsearches’ ] = ‘pma__savedsearches’ ;

  25. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘central_columns’ ] = ‘pma__central_columns’ ;

  26. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘designer_settings’ ] = ‘pma__designer_settings’ ;

  27. $ cfg [ ‘Servers’ ] [ $ i ] [ ‘export_templates’ ] = ‘pma__export_templates’ ;

14,重启phpmyadmin

[root @ localhost phpMyAdmin]#nginx -s重新加载

15,访问phpMyAdmin

浏览器访问服务器IP +端口,如下图

转载请注明:XAMPP中文组官网 » XAMPP新闻_Linux环境安装phpMyadmin

您必须 登录 才能发表评论!