MYSQL ==>> MARIADB

Source: Internet
Author: User

Prepare the database (MySQL), if you already have MySQL, can be ignored.

Build MySQL table;

Connect to MySQL;

Mysql-u root-p

Create a data table;

Mysql> CREATE DATABASE demo;

Mysql> use demo;

Mysql> CREATE TABLE Pet (name varchar (), owner varchar (+), species varchar (+), sex char (1));

Add data table contents;

Mysql> INSERT into pet values (' Brandon ', ' Jack ', ' Puddle ', ' m '), (' Dixie ', ' Danny ', ' Chihuahua ', ' f ');

Exit (); ----Quit MySQL

Backup MySQL;

Previously prompt, enable binary;

Backup data table; backup my.cnf;

$ mysqldump--all-databases--user=root--password--master-data > Backupdb.sql

$ sudo cp/etc/mysql/my.cnf/opt/my.cnf.bak

Del MySQL;

Stop the MySQL service;

$ sudo service MySQL stop//rhel6

$ sudo systemctl stop MySQL//RHEL7

$ sudo/etc/init.d/mysql Stop//rhel6

Removing MySQL configuration and files;

$ sudo yum remove mysql* mysql-server mysql-devel mysql-libs

$ sudo rm-rf/var/lib/mysql

Build mariadb;

Install mariadb; and related dependency packages;

$ sudo vi/etc/yum.repos.d/mariadb.repo//Create a custom Yum source

....//The following is the contents of the file.//...../////* * * * * * * *

[MARIADB]

Name = MariaDB

BaseURL = Http://yum.mariadb.org/5.5/centos7-amd64

Gpgkey=https://yum.mariadb.org/rpm-gpg-key-mariadb

Gpgcheck=1

.......................................

$ sudo yum install mariadb-server mariadb-client//installation MariaDB

recover my.cnf files;

$ sudo cp/opt/my.cnf/etc/mysql/

Start mariadb;

$ sudo service mariadb start

$ sudo systemctl start mariadb

$ sudo/etc/init.d/mariadb Start

MySQL ==>> MARIADB;

Import the data table into the MARIADB;

$ mysql-u Root-p < Backupdb.sql

Appear the content, indicates the login success; congratulations.

$ mysql-u Root-p

.....//The following is the SQL command, which ....//..../////..//.

MariaDB [(None)]> show databases;

MariaDB [(None)]> use test01;

MariaDB [test01]> select * from pet;

The end of this article, welcome to visit;

For more information, please click <<MARIADB Official documents >>

MYSQL ==>> MARIADB

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.