Install MySQL on docker

Install MySQL on docker step by step example

$docker pull mysql
1. Display docker pull image for MySQL.
$docker images
2. Display docker images all.
$docker run -p 3306:3306 --name mysql-local -e MYSQL_ROOT_PASSWORD=P@ssw0rd -d mysql:latest --default-authentication-plugin=mysql_native_password
3. Display defined port and start server.
$docker ps
4. Display container running.
$docker update --restart unless-stopped mysql-local
5. Display running auto when shut down or restart computer.
$docker exec -it mysql-local bash$docker exec -it mysql-local /bin/sh
6. Display inside the running container.
$mysql -u root -p
7. Display defined username for MySQL.
$show databases;
8. Display database all.
Server :localhost
Database :
Port :3306
Username :root
Password :P@ssw0rd

--

--

No responses yet