MySQL must know the first verse

Source: Internet
Author: User

First, the initial knowledge of SQL language

SQL (Structured query Language, structured queries language)
the SQL language is primarily used to access data, query data, update data, and manage relational database systems, which are developed by IBM. There are 3 types of SQL languages:
DDL Statement Database Definition Language: Database, table, view, index, stored procedure, such as Create DROP ALTER
DML Statement Database manipulation language: Inserting data insert, deleting data Delete, updating data update, querying data Select
DCL Statement Database Control Language: for example, to control user access rights grant, REVOKE

second, the system database
Information_schema: It mainly stores information about some database objects in the system, such as user table information, column information, permission information, character information, etc.
Performance_schema: The performance parameters of the primary storage database server.
MySQL: Authorization library, the primary storage System user's permissions information. This library needs to be reinitialized if it is lost! But all previous authorization information is lost!
a test database that is automatically created by the Test:mysql database system. for a secure database, this library should be deleted because it is a shared library!

third, forget the MySQL password
# vim/etc/my.cnf
[Mysqld]
skip-grant-table
# service Mysqld Restart
# mysql

mysql> Select User,password,host from Mysql.user;
+------+-------------------------------------------+-----------+
| user | password | host |
+------+-------------------------------------------+-----------+
| root | *f861720e101148897b0f5239db926e756b1c28b3 | localhost |
| root | | sxl.com |
| root | | 127.0.0.1 |
| root | |:: 1 |
| | | | localhost |
| | | | sxl.com |
+------+-------------------------------------------+-----------+
6 rows in Set (0.00 sec)

mysql> Update mysql.user set Password=password ("456") where
User= "root" and host= "localhost";

mysql> flush Privileges;
mysql> \q

Iv. Creating a database
Grammar
CREATE database name;
database naming rules:
can consist of letters, numbers, underscores, @, #, $
Case Sensitive
Uniqueness
You cannot use keywords such as create select
numbers cannot be used alone
Maximum 128 bits

database-related operations
View Database
SHOW DATABASES;
SELECT Database ();---------------------> View the databases currently in Operation
Select database: Use database name
Delete database: Dorp database name;


This article is from the "xinsz08の parallel space-time" blog, be sure to keep this source http://xinsz08.blog.51cto.com/10565212/1915897

MySQL must know the first verse

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.