确认一下下载的image
[root@docker-hub ~]# docker image ls
i Info → U In Use
IMAGE ID DISK USAGE CONTENT SIZE EXTRA
hello-world:latest f7931603f70e 16.2kB 3.96kB U
mysql:5.7 4bc6bc963e6d 684MB 138MB
mysql:8.0.31 3d7ae561cf60 729MB 161MB U
mysql:8.4 b306273d4d36 1.07GB 236MB
mysql:latest 569c4128dfa6 1.27GB 278MB
[root@docker-hub ~]#
7.登录MYSQL容器
[root@docker-hub ~]# docker exec -it mysql-prod mysql -uroot -psztech_4U
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 8.0.31 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
8.修改root密码
mysql> alter user 'root'@'localhost' identified by 'newpass';
mysql> flush privileges;
mysql> alter user 'root'@'%' identified by 'newpass';
mysql> flush privileges;
10.修改参数配置
临时修改
mysql> set global innodb_buffer_pool_size=2147483648;
mysql> show variables like '%innodb_buffer_pool_size%';
+-------------------------+------------+
| Variable_name | Value |
+-------------------------+------------+
| innodb_buffer_pool_size | 2147483648 |
+-------------------------+------------+
1 row in set (0.00 sec)