美文网首页
docker中安装mysql

docker中安装mysql

作者: 爱吃的H先生 | 来源:发表于2020-05-26 23:59 被阅读0次

    1、sudo docker pull mysql:5.7

    2、sudo docker images

    3、docker run -p 3306:3306 --name mysql \

    > -v /mydata/mysql/log:/var/log/mysql \

    > -v /mydata/mysql/data:/var/lib/mysql \

    > -v /mydata/mysql/conf:/etc/mysql \

    > -e MYSQL_ROOT_PASSWORD=root \

    > -d mysql:5.7

    4、进入/mydata/mysql/conf

    [client]

    default-character-set=utf8

    [mysql]

    default-character-set=utf8

    [mysqld]

    init_connect='SET collation_connection =utf8_unicode_ci'

    init_connect='SET NAMES utf8'

    character-set-server=utf8

    collation-server=utf8_unicode_ci

    skip-character-set-client-handshake

    skip-name-resolve

    5、重启mysql

    docker restart mysql()

    相关文章

      网友评论

          本文标题:docker中安装mysql

          本文链接:https://www.haomeiwen.com/subject/jaabahtx.html