ubuntu20.04 apt方式安装mariadb

MariaDB作为MySQL的替代方案。MariaDB是一个与MySQL兼容的开源关系型数据库管理系统。

#1.打开终端。
#2.更新软件包列表:
sudo apt update
#3.安装MariaDB服务器和客户端:
sudo apt install mariadb-server mariadb-client -y
#4.查看状态
sudo systemctl status mariadb
#5.启动
sudo systemctl start mariadb
#6.开机启动
sudo systemctl enable mariadb
#7.登录
mysql -u root -p
#8.修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'kht';
#9.授权远程登录
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'kht' WITH GRANT OPTION; 
#10.刷新权限
flush privileges;
posted @ 2023-10-17 14:33  kht  阅读(366)  评论(0编辑  收藏  举报