http://www.aidlearning.net/
cd /etc/apt/&& cp sources.list sources.list.bk&& echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free > sources.list&& echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free >> sources.list&& echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free >> sources.list&& echo deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free >> sources.list&& echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free >> sources.list&& echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free >> sources.list&& echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free >> sources.list&& echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free >> sources.list&& apt update&& echo 换源已完成!&& cd /home
apt install default-mysql-server
mysql_install_db
service mysql start
/usr/bin/mysqladmin -u root password '1234' # 这里用的密码是1234,可自行更改成其他的密码
mysql -u root -p1234 # 密码自行更改
# 写入权限 grant all on *.* to root@'%' identified by '1234' with grant option; # 刷新权限并退出 flush privileges; quit;
# 打开配置文件 vim /etc/mysql/mariadb.conf.d/50-server.cnf
# 更改bind-address bind-address=0.0.0.0
kill -9 `pgrep mysql` service mysql start # 问题一:每次启动都会报错.回车一下就行(有没有大佬知道怎么解决的QAQ) # 问题二:不能自动启动
参考:https://www.cnblogs.com/xia-qaq/p/13334118.html
为方便直接进行复制粘贴,有作适当修改