目 录CONTENT

文章目录

debian安装mariadb

ashin
2021-08-18 / 0 评论 / 0 点赞 / 751 阅读 / 0 字

安装mariadb

apt-get install -y mariadb-server

更改root密码

mysql_secure_installation

重启

systemctl restart mariadb

开机自启动

systemctl enable mariadb

建库

登录mysql

mysql -u root 
CREATE DATABASE nextcloud;
CREATE USER 'oc_next'@'localhost' IDENTIFIED BY "123456";
GRANT ALL PRIVILEGES ON nextcloud.* TO 'oc_next'@'localhost';
grant all privileges on nextcloud.* to 'oc_next'@'%' identified by '123456' with grant option;
FLUSH PRIVILEGES;

开放远程连接

vi /etc/mysql/mariadb.conf.d/50-server.cnf

修改绑定IP127.0.0.1为0.0.0.0

开放防火墙

ufw allow 3306
0

评论区