CentOS安装MariaDB数据库(MySQL的分支)

树叶云

由于MySQL已经有闭源的趋势,所以大部分系统已经不建议使用MySQL,Mariadb是MySQL之父创建的一个MySQL分支项目,使用起来几乎一模一样。

1.CentOS安装MariaDB

# yum install mariadb-server mariadb-client

2.运行数据库

# systemctl start mariadb

3.进入数据库并创建一个production数据库

# mysql # MariaDB [(none)]> create database production;# MariaDB [(none)]> use production;# MariaDB [(none)]> flush privileges;

4.为production数据库创建一个远程登陆的用户

# MariaDB [(none)]> create user 'test1'@'%' identified by'test1';
# MariaDB [(none)]> grant all privileges on production.* to test1 identified  by'test1';
# MariaDB [(none)]> flush privileges;

5.使用test1用户连接数据库

# mysql -u test1 -p
Enter password: test1

6.登陆成功!

Welcome tothe MariaDB monitor.  Commands endwith ; or \g.
Your MariaDB connection id is 214
Server version: 5.5.52-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;'or'\h'for help. Type '\c'toclearthe current input statement.
MariaDB [(none)]>

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/220120.html<

(0)
运维的头像运维
上一篇2025-04-14 10:26
下一篇 2025-04-14 10:27

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注