Consider the proposal directly docker program, the current official mysql server docker support arm64, note that only mysql8 support, which is the latest label
In this and most commonly used x86 mysql mirror a little bit different, simply translate official documents add some, saying only that the program port access:
start up
docker run --name=mysql1 -d -p 3306:3306 mysql/mysql-server
This version of the mysql startup takes time, so be sure to change the state and other operational again, look at the state with docker ps, from the state health: starting to become healthy on the line.
Obtaining initial password, the official did not mention this matter to configure password with environmental parameters, if I did not support the measure, according to official
docker logs mysql1 2>&1 | grep GENERATED
Use this command to get the initial password from the docker log in. After the visit mysql, does not support cross-domain, starting a container access method
docker exec -it mysql1 mysql -uroot -p
The password input into the terminal just enter mysql, and then you can change the password.
alter user 'root'@'localhost' identified by 'password';
It is recommended that the user's cross-domain also changed, after all, we want to port access.
alter user set user.host='%' where user.user='root';
Of course, users can also build their own new line
create user 'userName'@'%' identified by 'password';
the above.