时间:2021-07-01 10:21:17 帮助过:5人阅读
6. 重启mysql
[root@WSyHRQ171356 mysql]# docker restart mysql
7. 进入mysql查询编码
[root@WSyHRQ171356 mysql]# docker exec -it mysql bash
root@29ac5990c680:/# mysql -uroot -p
mysql> show variables like ‘character%‘;
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
8. 创建mysql远程用户
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘密码‘ WITH GRANT OPTION;
9. 刷新生效
flush privileges;
10. 最后回到主机重启mysql即可
mysql> quit Bye root@29ac5990c680:/# exit [root@WSyHRQ171356 mysql]# docker restart mysql mysql [root@WSyHRQ171356 mysql]#
使用docker安装mysql服务
标签:star name 0.00 serve 目录 rar bash efault usr