docker-mysql 发表于 2021-03-15 分类于 Database 阅读次数: 本文字数: 635 阅读时长 ≈ 1 分钟 nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial mysql安装 可以酌情修改内存大小和交换内存大小。 12345678# filename: $HOME/data/mysql/conf/docker.cnf[mysqld]performance_schema_max_table_instances=400table_definition_cache=400table_open_cache=256performance_schema = offskip-host-cacheskip-name-resolve 12345678docker run \ --cpus 0.2 \ -d -e MYSQL_ROOT_PASSWORD=123456 \ --name mysql \ -v $HOME/data/mysql/data:/var/lib/mysql \ -v $HOME/data/mysql/conf:/etc/mysql/conf.d \ -p 3306:3306 \ mysql 允许远程登录 123docker exec -it mysql bashmysql -u root -p123456ALTER USER 'root'@'%' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY '123456';