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