Reprinted from Http://www.cnblogs.com/duhuo/p/5650876.htmlMySQL Query record if there is a timestamp field, the view results inconvenient, can not immediately see the meaning of the timestamp represents, now provides the MySQL format change time
Storage Engine
The storage engine is a table type, and MySQL has different processing mechanisms depending on the table type
Table is equivalent to a file, a record in the table is equivalent to a row of the file, but a record in the
July 7, 2015-------------------------1, TRUNCATE table will empty the value of the auto_increment of the table statement, the ID of a table is the primary key is also self-increment, you can choose to insert the random ID value, assuming not start
CentOS7 default database is MARIADB, configuration and so on is not used to, so decided to change to MySQL, but the CentOS7 yum source default seems to be no MySQL. To solve this problem, we need to download the MySQL repo source first.1. Download
In MySQL, does the field in the INSERT INTO insertion statement have to fill in all the fields of the table?For example, table Tab_name has (COL1,COL2,COL3,COL4) 4 fields.Just fill in what you need to add, and then write the column name with
One. Nginx Boot start1. Create a script in the/etc/init.d/directoryVim/etc/init.d/nginx2. Write the contents of the script (copy the following to change the installation path accordingly)#!/bin/bash# nginx Startup script forThe Nginx HTTP server# It
MySQL variables are divided into three categories.1, global variables (built-in variables): MySQL database built-in variables (all connections play a role) A. See All global variables: show variables; Select @@ 变量 name; Set variable
MySQL self-increment ID gets
The
uses the max function: select Max (ID) from tablename
Advantages: Easy and quick to use.
Disadvantage: Get not the real self-increment ID, is the largest ID in the table,
1. database table name naming specification The use of 26 letters (case-sensitive) and 0-9 of the natural number (often do not need) with an underscore ' _ ' composition; The name is concise and clear, and multiple words are separated
Saltstack execution results are saved to MySQL for command security auditsMust be an environment above python2.7Install related modulesUbuntu System InstallationApt-get install-y Python-mysqldbCentOS System InstallationYum Install-y
I. System InformationLinux version: 6.8MySQL Version info:/mysql-5.7.21-linux-glibc2.12-x86_64.tar.gzTwo machine IPs:192.168.196.220192.168.196.221DescriptionMySQL installation directory:/opt/mysqlMySQL Data pavement:/data/mysqlTwo. Install the
Develop a daemon script that monitors MySQL master-slave replication anomalies (including unsynchronized and delayed) every 30 seconds#!/bin/bashfile=/root/mysql.txt #mysql > Show slave status\g; This command can view status information and save it
One, the two methods of installationFirst Kind#安装pip3 Install PymysqlThe second KindSecond, link, execute SQL, close (cursor)Import pymysqluser= input (' User name:>> '). Strip () pwd= input (' Password:>> '). Strip () #先链接, get the cursor
Recently in the completion of the MySQL project integration, need to increase the functionality of the batch update, according to the online data collated a bit, very useful, have been tested, can be used directly.MySQL batch update has the
Generate a random eight-digit discount code and save it to the Mysql database.
Currently, many sellers use discount codes to perform activities. Now we can easily implement eight-digit discount codes and store them in the database.
1. The randomly
MySQL replication advantages and principles
Replication transfers the DDL and DML operations of the primary database to the slave database through binary logs, and rewrites the data from the slave database to ensure data synchronization between the
MySQL quick comparison data skills, MySQL DATA skills
In MySQL O & M, R & D colleagues want to compare the data on two different instances and find out the difference. In addition to the primary key, they also need to compare each field. How can
When MySQL uses indexes and when it does not use indexes.
Index:
You can use indexes to quickly access specific information in database tables. An index is a structure that sorts the values of one or more columns in a database table, for example,
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