phpmyadmin环境搭建笔记贴
文章目录
环境:ubuntu 16.04
安装mysql
sudo apt-get install mysql-server mysql-client
注意把设置的数据库用户名与密码记录
外网访问
bind-address = 127.0.0.1
修改为 bind-address = 0.0.0.0
重启
systemctl restart mysql
权限修改
# mysql -uroot -p
msyql> use mysql
msyql> update user set host = '%' where user = 'root';
msyql> flush privileges;
msyql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
新版应该是需要重新创建一个用户
# mysql -uroot -p
msyql> create user 'root'@'%' identified by '123';
msyql> grant all privileges on *.* to 'root'@'%' identified by '123' ;
msyql> flush privileges;
安装apache2
非必须,phpmyadmin好像依赖它,笔者是先装apache2的。
sudo apt-get install apache2
默认服务路径:/var/www/html
修改端口
vi /etc/apache2/ports.conf
重启apache2
systemctl restart apache2.service
安装phpmyadmin
sudo apt-get install phpmyadmin
安装中需要填写mysql的密码
配置路径
rm -rf /var/www/html
ln -s /usr/share/phpmyadmin /var/www/html
配置phpmyadmin文件路径
/etc/phpmyadmin/config.inc.php
配置服务器列表
$i++;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = '192.168.1.161';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123456root7890';
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
配置apache最大传文件
apache默认最大上传2M大小文件,导出导入数据库时不够用
vi /etc/php/7.0/apache2/php.ini
file_uploads = On
默认值
upload_max_filesize = 200M
默认值加了两个0
post_max_size = 800M
默认值加了两个0
max_execution_time = 300
默认值加了一个0
memory_limit = 1280M
默认值加了一个0
vi /etc/phpmyadmin/config.inc.php
$cfg['ExecTimeLimit'] = 0;
添加
/usr/share/phpmyadmin/libraries/config.default.php
中默认值是300,也可以改默认值,但是不建议修改默认值