MySQL by default imposes connection restrictions for security reasons. To allow for external connections, such as from MySQL Workbench, specific modifications are required.
docker run -p 3306:3306 --name=mysql57 -d mysql/mysql-server:5.7
docker logs mysql57 2>&1 | grep GENERATED
docker exec -it mysql57 mysql -uroot -p
update mysql.user set host = '%' where user='root';
docker restart mysql57
You can now connect to MySQL from MySQL Workbench using the following parameters:
After these modifications, the connection restrictions will be lifted, allowing access to MySQL from external hosts, including MySQL Workbench.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3