apache容器遠(yuǎn)程mysql容器導(dǎo)入數(shù)據(jù)庫(docker)
1.遠(yuǎn)程訪問apache容器
2.因為centos7默認(rèn)是安裝mariadb,所以yum remove mariadb*
3.yum list installed mysql* mariadb*
4.wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
5.rpm -ivh mysql-community-release-el7-5.noarch.rpm 此時yum源中會有mysql的源
6.yum install mysql
7.find / -name mysqld 然后啟動mysql
8.mysql -h ip -u user -p
9.source 路徑(apache容器下的sql文件路徑)
啟動mysql服務(wù)期間可能遇到問題:
1.TIMESTAMP with implicit DEFAULT value is deprecated
解決辦法:
在/etc/my.cnf 文件中的[mysqld]下添加一行explicit_defaults_for_timestamp=true。就可以了
2.Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
解決辦法:
在/etc/my.cnf文件中,指定user=root;
3.Plugin 'FEDERATED' is disabled
解決辦法:
沒有初始化,執(zhí)行/usr/bin/mysql_install_db --user=mysql