Ubuntu18.04安装mariadb

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

CrystalGabrielle

喜欢就投喂一下吧~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值