In Flask-sqlalchemy, insert, modify, delete operations are managed by the database session.
The session is represented by Db.session. Before preparing to write the data to the database, add the data to the session and then call the
1. View slave statusshow slave status\G2, stop slave State, clear the master-slave information from the librarystop slave;reset slave all;3. Deleted from library synchronized main library databaseDROP DATATBASE DBNAME;4. Backing up primary database
A constraint is a restriction that ensures the integrity and uniqueness of a table's data by restricting the data on the table's Rows or columnsConstraint classification:Constraint types and keywords:
Primary KEY PRIMARY Key
Default
auto_increment Questions:Https://yq.aliyun.com/articles/59263?spm=5176.8091938.0.0.bjzoFNHttps://dev.mysql.com/doc/refman/5.7/en/innodb-auto-increment-handling.htmlSeveral situations that cause auto_increment to become smaller:Reference:
1. Download: Http://dev.mysql.com/downloads/mysql/5.6.html#downloadsDownload version: I choose here 5.6.33, General edition, Linux under 64-bitYou can also directly copy the 64-bit, download by command: wget http://dev.mysql.com/get/Downloads/MySQL-5
MySQL (default data table Myisam&inonodb)Can be set in MySQL config file My.ini, the book is written in Default-table-type. But not found in the My.ini, but# The default storage engine that would be used when create new tables
Find your own MySQL installation directory, find My.ini, in the [MYSQLD] Paragraph add a sentence: Skip-grant-tables (role is to skip the user login process, directly log on to MySQL)You can then log in to MySQL in CMD andmysql> use MySQL; mysql>
Initiating a request from the database to the primary databasePrimary database validation request, if authentication is passed, turn on I/O threadSending bits files from a database to the primary databaseThe primary database matches the value of the
1, first confirm the error Binlog and last event.2, then go to the main machine to see the error content and the location of the error, if the end of the error, you can directly from the new Binlog synchronization.#/mysql/logs#.
MySQL is not sensitive to trailing spaces73530589Conclusion: It is recommended to trim the string in the query condition, preferably trim when the data is in storage.Example1:The field values in the table do not have spaces, where the query
MySQL backup can be divided into cold backup and hot backup two kinds.Cold backup: Stop the database service for backupHot backup: Do not stop the database service for backupMySQL storage engine for MyISAM, only support cold backup, you can directly
First, download the MySQL websiteOpen official Website address: www.mysql.com, select DOWNLOADS, go to the MySQL download page, at the bottom of the page there is a MySQL Community Edition, and there is a blue link belowClick to go to the download
1. Adding and removing changes and checking operationInquire:SELECT * from table name where field name operator number/character;Modify:Update table name SET field name = value,... where field name operator number/characterDelete:Delete from table
version:6.7.6+1. Create User:Create user username identified by ' mypassword ';OrCreate user ' test ' @ ' 127.0.0.1 ';2, change the password:Alter user test identified by ' test ';3. Set permissionsGrant all privileges the mydb.* to ' test ' @ '
MYSQL.CNF add[Mysqld]Character-set-server=utf8Collation-server=utf8_general_ci[Client]Default-character-set=utf8[MySQL]Default-character-set=utf8drop database user;CREATE DATABASE IF not EXISTS user character set UTF8;CREATE DATABASE IF not EXISTS
I. OverviewAll MySQL column types can be indexed and are the best way to improve the performance of select queries. Depending on the storage engine, you can define the maximum number of indexes and the maximum index length for each table, and each
MySQL default sort:https://forums.mysql.com/read.php?21,239471,239688#msg-239688
depend on order when order by is missing.
Always specify order by if you want a particular order – in some situations the engine can eliminate the order by
1. Table name case sensitive, Linux down to MySQL:
Database name and table name are strictly case-sensitive;
Table aliases are strictly case-sensitive;
The alias of the column name and column is ignored in all cases;
Variable names
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