ObjectiveThe database storage engine is the database's underlying software organization, and the Database management system (DBMS) uses the data engine to create, query, update, and delete data. Different storage engines provide different storage
1.SQL not NULL constraintThe NOT NULL constraint enforces that the column does not accept null values.A NOT NULL constraint forces a field to always contain a value. This means that if you do not add a value to the field, you cannot insert a new
Common functionsarithmetic FunctionsI believe you can understand, so the above is not too much explanationAnd then there's the between and: the one that's missing from the front.Indicates whether 10 is between 0 and 20 and returns 0 if it returns
The syntax of a single-table querySELECT Field 1, Field 2 ... From table name WHERE condition GROUP by field have filter ORDER by field limit number of bars Second, the execution order of the
I. System database
INFORMATION_SCHEMA: Virtual library, do not occupy disk space, storage is the database startup parameters, such as user table information, column information, permission information, character information, etc.
MySQL:
MySQL Installation:
at command-line input sudo apt- get install Mysql- server
A window will pop up during installation, enter the password for the database root user ( must enter password )
查看表上的索引状态:SHOW INDEXReturns table index information.SHOW KEYSand is SHOW INDEXES synonyms for SHOW INDEX .Grammar:Show {index|indexes} from table_name [from db_name] [where expr]The following fields is returned by SHOW INDEX .
Field
There are times when we manipulate database tables, but when we insert data into a table, we encounter data that already exists in the table for that ID or data without that ID, insert it directly when there is no data for that ID, and then update
The first stepCreate a databaseCREATE database nameStep TwoBuild tableCREATE TABLE Qquser(Qqid INT PRIMARY KEY not NULL,PASSWORD VARCHAR () not NULL,Lastlogintime DATETIME not NULL,Online INT not NULL,Levle INT not NULL)CREATE TABLE Baseinfo (Qqid
The relationship of the MySQL tableRelationship of the table:One-to-one: 1:1Eg: a person has only one identity cardNote: one-to-one key fields can be implemented by adding key fields.--Method OneCREATE TABLET_person (IDINT PRIMARY
MySQL Log management error logConfiguration method:vim/etc/my.cnf[mysqld]log-error=/tmp/mysql.logTo see how to configure:' %log%error% ';Role:Log the general status of MySQL database and error information, is our database of regular error processing
What do you mean businessA transaction is a set of operations units of SQL, either the operation succeeds or all fails.Acid attribute atomicity (atomicity)A thing must be considered as an inseparable minimum unit of work, the entire transaction
Very few do not pay attention to the database garbled situation, resulting in character errors:The default is the Latin character set:The table created in this library is also a Latin character set:Insert the normal data below:The display is
Https://help.aliyun.com/knowledge_detail/41738.htmlMySQL full: Record pos locationMysqldump-h10.10.10.1-uadmin-p--master-data=2--single-transaction-r--events-q--all-databases > 2.sqlCat 2.sql |head-2222 Rows in the exported backup see the POS
This tutorial is for password field invalidation for password reset.Relatively simple, as follows:1, Linux under the Change/etc/my.cnf "Windows location please Baidu" to find the [mysqld] field, the following plusSkip-grant-tables2. Exit save, enter
In MySQL, after a transaction commits, it is necessary to write undo, write Redo, write binlog, write data files, and so on. In this process, crash may occur at a certain step, which may result in inconsistent master-slave data. To avoid this
Use mysqldump to back up and restore the database,
Database storage engine: InnoDB
Enable binlong1. Restore the database accidentally deleted to the latest status
1. Back up the database
mysqldump -A -F -uroot -p --master-data=2 --single-transaction
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