1、apt install mariadb
2、
mariadb =
show global variables like 'port' ##查看端口号
#设置root 密码 远程访问
# 登录mysql,在默认安装时如果没有让我们设置密码,则直接回车就能登录成功。
mysql -uroot -p
# 设置密码 mysql8.0
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';
# 设置密码 mysql5.7
set password=password('新密码');
# 配置IP 5.7
grant all privileges on *.* to root@"%" identified by "密码";
# 刷新缓存
flush privileges;
grant all privileges on *.* to 'root'@'%' identified by 'root'
flush privileges
#修改文件:
find / -name *y.cnf
/etc/mysql/mariadb.conf.d#
#重启服务
systemctl restart mariadb
#查看防火墙
ufw status
systemctl start mariadb #启动MariaDB
systemctl stop mariadb #停止MariaDB
systemctl restart mariadb #重启MariaDB
systemctl enable mariadb #设置开机启动
内网连接mysql慢解决办法