在mac运行docker版mysql

# get mysql docker image

docker pull mysql
# start mysql container
docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql

# get into mysql container
docker exec -ti mysql /bin/bash

# login mysql
mysql -u root -p

# allow all users to login into mysql
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';

你可能感兴趣的:(在mac运行docker版mysql)