MARIADB Basic Management operations

Source: Internet
Author: User
Tags create database mysql database
A MariaDB MariaDB is a compatible open source version of MySQL.
Simple use of two MARIADB 1. Installing the MARIADB
Yum insatll mariadb Mariadb-server
Systemctl Start mariadb
Systemctl Enable MARIADB
2. Firewall turned on
Firewall-cmd--permanent--add-service=mysql
Firewall-cmd--reload
3. Initialization of the database (execution after installation is complete)
Mysql_secure_installation Database Initialization Command Step 1th: Set the root user password. 2nd Step: Delete the anonymous account.
3rd step: Prohibit the root user from remote login.
4th step: Delete the test database and remove access to it.
5th step: Refresh the authorization table, so that the initialization of the settings immediately effective. 4. Data Operations Management
1. Database login Mysql-u username-p (after which you can enter a password to enter the interactive management interface)
2. Introduction to database architecture and the database is a multi-relational database, the relational database consists of one or more data forms (table), and the data form holds multiple data records (record). 1. Show the existing relational database show databases;

Create Database Database-name; Create a new database
Drop database database-name; Deleting a database
Use Database-name; Specify to use the database
2. Display form information and data logging operations for the relational database used
Show tables;                Displays information about the forms in the current relational database. CREATE TABLE Table-name (field1 type,filed2 type); Create forms and specify formatting
Describe Table-name; View form Structure Description
drop table table-name; Delete a form
Delete from Table-name; Delete all the contents of the form delete from table-name where filed condition; Delete the row that satisfies the Where condition
SELECT * from Table-name; View form data
Select Field1,filed2 from Table-name; View only field1,2 column content data
SELECT * from table-name where field condition; Find the data for the row filed satisfies the condition update table-name set filed=?; Modify field all data for.
Update table-name set filed=? where field conditions; Modify the field data that satisfies where to become.
The following table is where the parameter action is used.
3. User management and user Rights Management 1. User Management (user information is stored in the MySQL relational database user form)
Create user username @ Host name identified by ' password '; Create a new user select Host,user,password from user;            View user information (a few important information), in fact, is to query the MySQL database user form information, other modifications to the user, delete operations similar to the normal form of operation.  2. User Rights Management grant permissions on Database-name.table-name to username @ host; Assign permission permissions to a form in a relational database: Select, UPDATE, delete, insert
Show grants for user name @ host; View User Permissions

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.