MariaDB Basics

MariaDB database management system is a fork of MySQL, mainly maintained by the open source community. It is licensed under the GPL. The purpose of MariaDB is to be fully compatible with MySQL, including API and command line, making it an easy replacement for MySQL. In terms of storage engine, XtraDB (English: XtraDB) is used instead of MySQL's InnoDB. MariaDB was developed by Michael Widenius, the founder of MySQL, who sold his own company, MySQL AB, to SUN for $1 billion. Since then, with the acquisition of SUN by Oracle, MySQL Ownership also falls into the hands of Oracle. The MariaDB name comes from the name of Michael Widenius' daughter Maria.

 

MariaDB's transaction-based Maria storage engine, which replaces MySQL's MyISAM storage engine, uses Percona's XtraDB, a variant of InnoDB that developers of the fork hope to provide access to the upcoming MySQL 5.4 InnoDB performance. This release also includes PrimeBase XT (PBXT) and FederatedX storage engines.

 

MariaDB until version 5.5 follows the MySQL version. Therefore, people using MariaDB 5.5 will know all the features of MariaDB from MySQL 5.5.

 

MariaDB is one of the corporate recommend database solutions, in order to replace MySQL and other commercial DB.

 

===================================

 centos7自带的mysql是mariadb
yum install mariadb mariadb-server
systemctl enable mariadb
systemctl start mariadb


Initialize database
mysql_secure_installation


Note: At Enter current passwdord for root, we can just hit the Enter key. Because the default root user password of mysql on centos7 is empty.

 

===================================

start up:

[root@localhost ~]# systemctl start mariadb.service 
[root@localhost ~]# systemctl enable mariadb.service

After startup, the default password of mariadb is empty

 

===================================

1. Log in to the terminal as root, you must
2. Enter mysqladmin -u root -p password
The root behind root is the password to be set
3. Enter password 
and enter the password after pressing Enter, if not, press Enter directly

 

//Create a user
mysql> insert into mysql.user(Host,User,Password) values("localhost","admin",password("admin"));
//Refresh the system privilege table
mysql>flush privileges;
this creates A user named: admin password is: admin.

 

//Create a database (under root privileges)
create database mydb;
//Authorize the admin user to have all the privileges of the mydb database.
>grant all privileges on mydb.* to admin@localhost identified by 'admin';
//Refresh the system privilege table
mysql>flush privileges;

 

//删除用户
@>mysql -u root -p
@>密码
mysql>DELETE FROM user WHERE User="admin" and Host="localhost";
mysql>flush privileges;


//Delete the user's database
mysql>drop database mydb;

 

//Modify the specified user password
@>mysql -u root -p
@>password
mysql>update mysql.user set password=password('new password') where User="admin" and Host="localhost";

MySQL >flush privileges;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326102679&siteId=291194637