由于 linux 下 mysql 区分大小写,所以需要修改 mysql 配置文件 在 [mysqld] 下增加一项属性 lower_case_table_names = 1 ,然后重启 mysql 服务即可
修改的时候发现 mysql容器里没有 编辑工具,所以安装 vim
进入 mysql 容器
主机执行
docker exec -it <mysql容器id> bash
配置国内镜像源
mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list
echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list
echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
#更新安装源
apt-get update
如果下载过程中卡在[waiting for headers]
可能的解决方法
1. 删除/var/cache/apt/archives/下的所有文件。可能是上次没有成功导致遗留了部分文件。
2. 如果使用的是代理,需要检查DNS。如果机器不能连接DNS服务器,要将sources.list中的源地址换成IP。
#安装命令
apt-get install -y vim
修改 mysql 配置文件使其不区分大小写
编辑/etc/mysql/mysql.conf.d/mysqld.cnf文件
[mysqld]后添加
lower_case_table_names=1
重启 mysql 服务
service mysql restart