mysql 5.7 upgrade to mysql8
mysql 5.7 upgrade to mysql 8 , upgrade mysql8 for wordpress5.x ,wordpress in docker~
notice
The default encryption method of mysql8 is changed to caching_sha2_password. The old version of php is not supported,
so you must add “default_authentication_plugin=mysql_native_password” to my.conf file
docker onekey command
1 |
docker run -d --restart=always --name=mysql -v /data/mysql/:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:latest --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --default-authentication-plugin=mysql_native_password |
docker backup data
1 |
docker exec CONTAINER mysqldump -u root --password=root DATABASE > backup.sql |
docker restore data
1 |
cat backup.sql | docker exec -i CONTAINER mysql -u root --password=root DATABASE |
by cpp.la 20190115