phpmyadmin环境搭建笔记贴

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,也可以改默认值,但是不建议修改默认值

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值