Ubuntu18.04安装mariadb
数据库信息
数据库用户:root
数据库密码:123456
数据库基础安装
#更新软件
sudo apt update
sudo apt upgrade -y
#安装服务
sudo apt-get install mariadb-server -y
#启用启动服务
sudo systemctl start mariadb
sudo systemctl enable mariadb
#后续设置命令
mysql_secure_installation
#移除匿名用户
#允许root远程登录
#移除测试数据库
#重新加载权限表
#登录数据库(本地)
mysql -u root
#登入数据库后,设置所有用户使用root连接,并更新设置。
mysql> grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
mysql> flush privileges;
修复远程访问bug
ubuntu下安装mariadb之后是无法远程连接的,需要参考这篇文章
《解决Ubuntu下mariadb不能远程访问》
sudo apt install vim -y
vim /etc/mysql/mariadb.conf.d/50-server.cnf
#注释掉bind-address = 127.0.0.1
reboot
#重启服务器
修复腾讯云服务器新装数据库root无密码不能登录问题
https://www.cnblogs.com/Guhongying/p/10901895.html