Skip to main content

Debain10 安装 mariadb

安装服务

apt install mariadb-server

启动服务

systemctl start mariadb

增加权限

CREATE DATABASE  my_test_db;
GRANT ALL ON my_test_db.* TO 'test_user'@'localhost' IDENTIFIED BY 'test_user_pass_here' WITH GRANT OPTION;
FLUSH PRIVILEGES;

cd /etc/mysql/ grep -rn "skip-networking" *

注释掉 bind-address 项

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.%' IDENTIFIED BY '202402.' WITH GRANT OPTION;
FLUSH PRIVILEGES;