微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

CentOS安装MariaDB数据库MySQL的分支

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

1.安装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 to the MariaDB monitor.  Commands end with ; 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' to clear the current input statement.
MariaDB [(none)]>

原文地址:https://www.jb51.cc/centos/378763.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。