docker安装mysql:5.7

2021-02-16  本文已影响0人  Terry_Qian
    docker pull mysql:5.7
    ## 反斜杠\前面要有空格!
    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
    vim mydata/mysql/conf/my.cnf
    [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
    docker restart mysql
上一篇 下一篇

猜你喜欢

热点阅读