Navicat破解网址 https://www.jianshu.com/p/5f693b4c9468
docker pull mysql
docker run -d -p 3306:3306 --name mysql01 mysql/mysql-server
docker logs mysql01 查看日志有默认密码
docker exec -it mysql01 bash 进入到容器里面
# mysql -uroot -p 默认是localhost,然后输入密码
use mysql 提示必须要改密码
修改用户密码 alter user 'root'@'localhost' identified by '123456';
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password123');
select user,host from user //user表显示信息 改信息
mysql> CREATE USER 'Anker'@'localhost' IDENTIFIED BY 'pwd123456';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'Anker'@'localhost' WITH GRANT OPTION;
mysql> CREATE USER 'Anker'@'%' IDENTIFIED BY 'pwd123456';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'Anker'@'%' WITH GRANT OPTION;
后面有字符集问题 没有默认字符集 中文会乱码应改成utf-8
show variables like '%char%'; 查看所有链接字符集
exit 退出mysql 用户,但还在容器里面
cd /etc cat my.cnf yum install vim 安装vi编辑器
[mysqld] user=mysql character-set-server=utf8 [client] default-character-set=utf8 [mysql] default-character-set=utf8
docker 资料卷
docker restart mysql01 重新启动
docker inspect mysql01 配置参数
docker run -d -p 3306:3306 --name mysql01 -v=/docker/mysql/config/my.cnf:/etc/my.cnf -v=/docker/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql/mysql-server
docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=123456' -e 'MSSQL_PID=Developer' -p 1433:1433 -v=/E:/docker/mssql:/var/opt/mssql --name sql1 -d microsoft/mssql-server-linux:2017-latest
MySql.Data.EntityFrameworkCore