多年没有接触phpmyadmin了,因为线上服务器不开放3306端口,也不想去代理一个端口或者映射出3306,于是便想用一下phpmyadmin。有docker使用起来确实要简单很多。下载镜像填写好账号启动镜像即完成服务。启动后访问对外窗口端口即可。本文地址:http://www.04007.cn/article/1045.html,未经许可,不得转载.
#下载镜像并启动容器 docker pull phpmyadmin/phpmyadmin docker run -d --name phpmyadmin \ -e PMA_HOST=192.168.12.112 \ -e PMA_PORT=3306 \ -p 8008:80 \ phpmyadmin/phpmyadmin本文地址:http://www.04007.cn/article/1045.html,未经许可,不得转载.
上述docker命令中选项说明如下:
-e PMA_HOST=192.. #这是MYSQL数据库的IP地址
-e PMA_PORT=3306 #数据库的端口
-p 8008:80 将容器中phpmyadmin的80端口映射到主机的8008端口本文地址:http://www.04007.cn/article/1045.html,未经许可,不得转载.
phpmyadmin实际可以支持多个数据库,可以通过PMA_HOSTS指定多个。也有其它MAX_EXECUTION_TIME、MEMORY_LIMIT、UPLOAD_LIMIT(执行时间、内存、上传限制)等选项,所有可供使用的选项如下:本文地址:http://www.04007.cn/article/1045.html,未经许可,不得转载.
PMA_ARBITRARY - when set to 1 connection to the arbitrary server will be allowed PMA_HOST - define address/host name of the MySQL server PMA_VERBOSE - define verbose name of the MySQL server PMA_PORT - define port of the MySQL server PMA_HOSTS - define comma separated list of address/host names of the MySQL servers PMA_VERBOSES - define comma separated list of verbose names of the MySQL servers PMA_PORTS - define comma separated list of ports of the MySQL servers PMA_USER and PMA_PASSWORD - define username and password to use only with the config authentication method PMA_ABSOLUTE_URI - the full URL to phpMyAdmin. Sometimes needed when used in a reverse-proxy configuration. Don't set this unless needed. See documentation. PMA_CONFIG_BASE64 - if set, this option will override the default config.inc.php with the base64 decoded contents of the variable PMA_USER_CONFIG_BASE64 - if set, this option will override the default config.user.inc.php with the base64 decoded contents of the variable PMA_CONTROLHOST - when set, this points to an alternate database host used for storing the phpMyAdmin Configuration Storage database database PMA_CONTROLPORT - if set, will override the default port (3306) for connecting to the control host for storing the phpMyAdmin Configuration Storage database database PMA_PMADB - define the name of the database to be used for the phpMyAdmin Configuration Storage database. When not set, the advanced features are not enabled by default (they can still potentially be enabled by the user when logging in with the zero conf (zero configuration) feature. Suggested values: phpmyadmin or pmadb PMA_CONTROLUSER - define the username for phpMyAdmin to use for advanced features (the controluser) PMA_CONTROLPASS - define the password for phpMyAdmin to use with the controluser PMA_QUERYHISTORYDB - when set to true, enables storing SQL history to the phpMyAdmin Configuration Storage database. When false, history is stored in the browser and is cleared when logging out PMA_QUERYHISTORYMAX - when set to an integer, controls the number of history items. See documentation. Defaults to 25. MAX_EXECUTION_TIME - if set, will override the maximum execution time in seconds (default 600) for phpMyAdmin ($cfg['ExecTimeLimit']) and PHP max_execution_time (format as [0-9+]) MEMORY_LIMIT - if set, will override the memory limit (default 512M) for phpMyAdmin ($cfg['MemoryLimit']) and PHP memory_limit (format as [0-9+](K,M,G)) UPLOAD_LIMIT - if set, this option will override the default value for apache and php-fpm (format as [0-9+](K,M,G) default value is 2048K, this will change upload_max_filesize and post_max_size values) HIDE_PHP_VERSION - if defined, this option will hide the PHP version (expose_php = Off). Set to any value (such as HIDE_PHP_VERSION=true).本文地址:http://www.04007.cn/article/1045.html,未经许可,不得转载.
本文地址:http://www.04007.cn/article/1045.html 未经许可,不得转载. 手机访问本页请扫描右下方二维码.
![]() |
![]() |
手机扫码直接打开本页面 |