docker里重装mysql
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker里重装mysql相关的知识,希望对你有一定的参考价值。
1.查看ubuntu下装了什么软件:
dpkg -l
2.删除mariadb:
apt-get autoremove --purge mariadb-server-10.0
apt-get remove mariadb-server
apt-get autoremove mariadb-server
apt-get remove mysql-common
3.安装mysql
apt-get install mysql-server
4.更新密码
update user set password=password(‘new_password‘) where user=‘root‘
flush privileges;
5.启动mysql
sudo /etc/init.d/mysql restart
6.外部连接:
grant all on *.* to [email protected]"%" identified by "root";
flush privileges;
以上是关于docker里重装mysql的主要内容,如果未能解决你的问题,请参考以下文章
SpringBoot docker连接到mysql docker容器