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 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)]>

分享文章:CentOS安装MariaDB数据库(MySQL的分支)
文章分享:http://www.shufengxianlan.com/qtweb/news47/436697.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联