"Original" https://www.toutiao.com/i6594314336913588743/How MySQL handles billions of data, the first phase-optimizing SQL statements1. Try to avoid using the! = or <> operator in the WHERE clause, or discard the engine for a full table scan using
由于日志文件是掌握数据库运行状态的重要参考,因此日志文件的维护也有十分重要的意义。 mysql的日志类型有二进制日志,错误日志,通用日志,慢查询日志。
Add log analysis to the moduleLog-bin=mysql_bin//binary logLog-error=/usr/local/mysql/data/mysql_error.log//error logGeneral_log=on//Turn on universal
1. Download the green version of the MySQL archive package. (Self-Baidu)2. Self-Planning Directory decompression3. InstallationNote: I have encountered two versions of the installation method (temporarily according to the extracted directory
First we need to know what data we repeat,///Step one: Group the data tables, GROUP by.The second step: after the conduct through having to limit filtering, the number of bars greater than or equal to 2Step three: make multiple table
Column PropertiesThe column properties are also called field properties, MySQL in a common 6 Properties: NULL , default value, column description, primary key, unique key, and autogrow. Null propertyThe null attribute indicates that the field is
Table relationshipsTable relationships: What is the relationship between a table and a table (entity), and how the table structure should be designed for each relationship.OneOne-to-one, a single record in a table has at most one clear relationship
The relational database relies on the primary key, which is the cornerstone of the database physical pattern. There are only two uses of the primary key at the physical level:Uniquely identifies a row.As an object that can be effectively referenced
Several storage engines commonly used by MySQLMyISAM:(1) do a lot of count calculation;(2) The insertion is not frequent, the query is very frequent;(3) No business.InnoDB:InnoDB Logical Storage structure:The data for all tables is logically stored
I. Characteristics of a transactionAtomicity, consistency, isolation, persistenceSecond, the isolation level of the transaction1. Non-submitted reading (read uncommitpeatableted)Infamous dirty read, other transactions uncommitted, still readable to2,
1. GrammarCREATE TABLE table name select: From table name where condition;2. Example1. Copy all records and fields of Moshou.sanguo table, Sanguo2CREATE TABLE Sanguo2SELECT * from Moshou.sanguo;2. Copy the first 3 records of the Moshou.sanguo table,
创建用户及密码mysql> create user ‘zhao‘@‘loacl‘ identified by ‘123123‘;mysql> use mysql;创建密文密码mysql> select password(‘123123‘); #查看明文对应的密文mysql> create user ‘test01‘@‘localhost‘ identified by #创建密文密码 ‘E56A114692FE0DE073F9A1DD68A00EEB9703F3F1‘;删除用户mysql>
MySQL Master-Slave introduction1, in the master server to the client's instructions to the data operation to the service side of master, the service side will write to the binary log according to the order in which the transactions are submitted.2,
#授权表user #该表放行的权限 for: All data, all tables under all libraries, and all the fields under the table db #该表放行的权限, for: a database, all tables under that database, and all the fields under the table Tables_priv #该表放行的权限. For: A table, and all fields
Operation of JSON dataCREATE TABLE IF not EXISTS Table_json (id BIGINT auto_increment,json json,primary KEY (id)); ALTER TABLE Table_json Add COLUMN name VARCHAR (GENERATED) always as (Json_extract (JSON, "$.name")) virtual; ALTER TABLE Table_json
Rights Management:If you want to create a new user, the following actions are required:1. Go to MySQL Databasemysql> Use mysqldatabase changed2. New User deletion1. Create User: # Specify ip:192.118.1.1 's MJJ User login create username ' mjj ' @ ' 1
Compiling the installation database (MySQL)First download the MySQL tar package,www.mysql.com DownloadI'm using mysql5.6.41 's tar package.Put the bag in the/usr/local directory.useradd -s /sbin/nologin mysql 创建mysql用户mkdir -p /data/mysql/data
an index base1. Definition:In MySQL, the index is also called "Key", which is a data structure used by the storage engine to quickly find records, which can improve query efficiency.The most effective means of optimizing query performance is index
1, DROP, truncate, delete difference TRUNCATE table is functionally the same as a DELETE statement without a WHERE clause: Both delete all rows in the table. However, TRUNCATE TABLE is faster than DELETE and uses less system and transaction log
First, Linux1, Linux to a file in bulk add a contentFirst vim into the file, then press CTRL + V and then select the number of lines you want, write what you're adding in Shift+i and then press ESCTwo, MySQL1, linux into the MySQL command line
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