文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

phpmyadmin怎么配置

2024-04-02 19:55

关注

小编给大家分享一下phpmyadmin怎么配置,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

开启记录history的参数是以下这个,当设置为true后就能将用户操作的sql记录在配合pmyadmin的pma_history中
$cfg['QueryHistoryDB'] = 'true'; //enable phpmyadmin record user sql


点击(此处)折叠或打开


  1. <?php



  2. if (!function_exists('check_file_access')) {

  3.     function check_file_access($path)

  4.     {

  5.      if (is_readable($path)) {

  6.         return true;

  7.      } else {

  8.         error_log(

  9.          'phpmyadmin: Failed to load ' . $path

  10.          . ' Check group www-data has read access and open_basedir restrictions.'

  11.         );

  12.         return false;

  13.      }

  14.     }

  15. }


  16. // Load secret generated on postinst

  17. if (check_file_access('/var/lib/phpmyadmin/blowfish_secret.inc.php')) {

  18.     require('/var/lib/phpmyadmin/blowfish_secret.inc.php');

  19. }


  20. // Load autoconf local config

  21. if (check_file_access('/var/lib/phpmyadmin/config.inc.php')) {

  22.     require('/var/lib/phpmyadmin/config.inc.php');

  23. }



  24. $i = 0;

  25. // The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use $cfg['Servers'][0].

  26. // You can disable a server config entry by setting host to ''.

  27. $i++;



  28. if (check_file_access('/etc/phpmyadmin/config-db.php')) {

  29.     require('/etc/phpmyadmin/config-db.php');

  30. }



  31. if (!empty($dbname)) {

  32.     

  33.     $cfg['Servers'][$i]['auth_type'] = 'cookie';

  34.     

  35.     if (empty($dbserver)) $dbserver = 'localhost';

  36.     $cfg['Servers'][$i]['host'] = $dbserver;


  37.     if (!empty($dbport) || $dbserver != 'localhost') {

  38.         $cfg['Servers'][$i]['connect_type'] = 'tcp';

  39.         $cfg['Servers'][$i]['port'] = $dbport;

  40.     }

  41.     //$cfg['Servers'][$i]['compress'] = false;

  42.     

  43.     $cfg['Servers'][$i]['extension'] = 'mysqli';

  44.     

  45.     $cfg['Servers'][$i]['controluser'] = $dbuser;

  46.     $cfg['Servers'][$i]['controlpass'] = $dbpass;


  47.     $cfg['QueryHistoryDB'] = 'true'; //enable phpmyadmin record user sql

  48.     //$cfg['QueryHistoryMax'] = '100'; //specify the amount of saved history sql

  49.     // Allow connection to server name ending with -mysql:

  50.     $cfg['ArbitraryServerRegexp'] = '@^[^:]\-mysql$@';

  51.     

  52.     $cfg['Servers'][$i]['pmadb'] = $dbname;

  53.     $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';

  54.     $cfg['Servers'][$i]['relation'] = 'pma__relation';

  55.     $cfg['Servers'][$i]['table_info'] = 'pma__table_info';

  56.     $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';

  57.     $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';

  58.     $cfg['Servers'][$i]['column_info'] = 'pma__column_info';

  59.     $cfg['Servers'][$i]['history'] = 'pma__history';

  60.     $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';

  61.     $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';

  62.     $cfg['Servers'][$i]['tracking'] = 'pma__tracking';

  63.     $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';

  64.     $cfg['Servers'][$i]['recent'] = 'pma__recent';

  65.     

  66.     

  67.     // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;


  68.     

  69.     $i++;

  70. }



  71. $i++;

  72. $cfg['Servers'][$i]['verbose'] = 'XXXXXX.com,1234';

  73. $cfg['Servers'][$i]['host'] = 'XXXXXX.com';

  74. $cfg['Servers'][$i]['port'] = 1234;

  75. $cfg['Servers'][$i]['socket'] = '';

  76. $cfg['Servers'][$i]['connect_type'] = 'tcp';

  77. $cfg['Servers'][$i]['extension'] = 'mysql';

  78. $cfg['Servers'][$i]['auth_type'] = 'cookie';

  79. $cfg['Servers'][$i]['user'] = '';

  80. $cfg['Servers'][$i]['password'] = '';

  81. $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';

  82. $cfg['Servers'][$i]['controluser'] = 'pma';

  83. $cfg['Servers'][$i]['controlpass'] = 'pmapassword';

  84. $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';

  85. $cfg['Servers'][$i]['relation'] = 'pma__relation';

  86. $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';

  87. $cfg['Servers'][$i]['table_info'] = 'pma__table_info';

  88. $cfg['Servers'][$i]['column_info'] = 'pma__column_info';

  89. $cfg['Servers'][$i]['history'] = 'pma__history';

  90. $cfg['Servers'][$i]['recent'] = 'pma__recent';

  91. $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';

  92. $cfg['Servers'][$i]['tracking'] = 'pma__tracking';

  93. $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';

  94. $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';

  95. $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';

  96. $cfg['Servers'][$i]['tracking_version_auto_create'] = true;



  97. $cfg['QueryHistoryDB'] = 'true'; //enable phpmyadmin record user sql

  98. //$cfg['QueryHistoryMax'] = '100'; //specify the amount of saved history sql





  99. //$cfg['Servers'][$i]['auth_type'] = 'cookie';


  100. //$cfg['Servers'][$i]['host'] = 'localhost';

  101. //$cfg['Servers'][$i]['connect_type'] = 'tcp';

  102. //$cfg['Servers'][$i]['compress'] = false;


  103. //$cfg['Servers'][$i]['extension'] = 'mysql';


  104. // $cfg['Servers'][$i]['controluser'] = 'pma';

  105. // $cfg['Servers'][$i]['controlpass'] = 'pmapass';



  106. // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';

  107. // $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';

  108. // $cfg['Servers'][$i]['relation'] = 'pma_relation';

  109. // $cfg['Servers'][$i]['table_info'] = 'pma_table_info';

  110. // $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';

  111. // $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';

  112. // $cfg['Servers'][$i]['column_info'] = 'pma_column_info';

  113. // $cfg['Servers'][$i]['history'] = 'pma_history';

  114. // $cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';

  115. // $cfg['Servers'][$i]['tracking'] = 'pma_tracking';

  116. // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

  117. // $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';

  118. // $cfg['Servers'][$i]['recent'] = 'pma_recent';


  119. // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;





  120. $cfg['UploadDir'] = '';

  121. $cfg['SaveDir'] = '';



  122. foreach (glob('/etc/phpmyadmin/conf.d

  123. $cfg['ServerLibraryDifference_DisableWarning'] = 'true';

看完了这篇文章,相信你对“phpmyadmin怎么配置”有了一定的了解,如果想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯