創建自啓動腳本:php
從網站下載安裝包:https://bitnami.com/stack/lampmysql
chmod 755 bitnami-APPNAME-VERSION-linux.run ./bitnami-APPNAME-VERSION-linux.run
修改mysql綁定的127.0.0.1。linux
cd /opt/lampstack/mysql vi my.cnf
註釋bind-address = 127.0.0.1sql
[mysqladmin] user=root [mysqld] basedir=/opt/lampstack/mysql datadir="/opt/lampstack/mysql/data" port=3306 socket=/opt/lampstack/mysql/tmp/mysql.sock tmpdir=/opt/lampstack/mysql/tmp max_allowed_packet=32M #bind-address=127.0.0.1 skip-name-resolve=1 character-set-server=UTF8 collation-server=utf8_general_ci [client] port=3306 socket=/opt/lampstack/mysql/tmp/mysql.sock default-character-set=UTF8 [manager] port=3306 socket=/opt/lampstack/mysql/tmp/mysql.sock pid-file=/opt/lampstack/mysql/tmp/manager.pid default-mysqld-path=/opt/lampstack/mysql/bin/mysqld.bin
激活phpmyadminapache
修改配置文件:/opt/bitnami/apps/phpmyadmin/conf/httpd-app.confapp
<Directory "/opt/bitnami/apps/phpmyadmin/htdocs"> # AuthType Basic # AuthName phpMyAdmin # AuthUserFile "/opt/bitnami/apache2/users" # Require valid-user AllowOverride None <IfModule php5_module> php_value upload_max_filesize 80M php_value post_max_size 80M </IfModule> <IfVersion < 2.3 > Order allow,deny Allow from all Satisfy all </IfVersion> <IfVersion >= 2.3> Require all granted </IfVersion> ErrorDocument 403 "For security reasons, this URL is only accesible using localhost (127.0.0.1) as the hostname" </Directory>
-------------------------------------------------------做廢socket
安裝phpmyadmin(做廢~)ide
下載並解壓,將phpmyadmin移到/opt/lampstack/apache2/htdocs目錄下。post
mv phpMyAdmin /opt/lampstack/apache2/htdocs/
更新權限
chown root:daemon phpMyAdmin/ -R
在/opt/lampstack/apache2/htdocs/phpMyAdmin目錄中新建文件夾tmp(或同上更新權限)。
cd /opt/lampstack/apache2/htdocs/phpMyAdmin/ mkdir -m 777 ./tmp