Reprinted from:Http://www.chinaxing.org/articles/Database/2015/10/23/2015-10-22-mysql-5.7.htmlPercona a test, in the case of MySQL5.7 innodb_page_size adjustment to 4k, can be improved than 16k performance of more than 70%;
In the previous section we completed the installation of MySQL, now we will open the actual combat mode, complete some basic MySQL operation. This section is divided into several parts:
User New in MySQL
Tag: Name active database operation operation date har name LAN textHeader (' Content-type:text/html;charset=utf-8 ');Mysqli_connect (' ip:3306 ', ' account ', ' Password ', ' database name to operate ');$con =mysqli_connect (' 127.0.0.1 ', ' root ',
(1) Port detection# Netstat-lntup |grep 3306|wc-l1#1表示mysql已开启, 0 means close#!/bin/bashPort= ' Netstat-intup |grep 3306|wc-l 'If [$port-ne 1 ]Then/etc/init.d/mysqld startElseecho "Mysql is running"Fi(2) Whether the MySQL version is
Data types in MySQLMySQL has three major classes of data types, number, date \ Time, string, and more detailed sub-types in the three categories:
Number Type
integers: tinyint, smallint, mediumint, int, bigint
Floating-point
The use of MySQL in Python is actually very simple, just install the corresponding module, then the corresponding modules have what? The official also did not specify also did not provide, PCAT recommended oneself encountered 3 modules:
I. Process Control statements1. Branch structureIf branch:IF condition 1 Then statement;ELSEIF condition 2 Then statement;......ELSE statement;END IF;Case Branch:case [Condition]When condition 1 Then statement 1When condition 2 Then statement 2......
After opening the terminal input:/usr/local/mysql/bin/mysql-u root–pThen enter the password:* * *Creating a database: Create databases work;Using the current database: use work;Creates a table: Create TABLE work (name char, sec char (x), age
The rights module in the background of the website is very common, so it is necessary to master 3 right separation.3 The right discrete table has the user table, the role table, the Permissions table, the corresponding relationship is as
Configure MySQL semi-sync, provided the master and slave environments are already in place.MySQL Semi-synchronous configurationMaster configurationInstalling the Semisync_master Pluginmysql> INSTALL PLUGIN rpl_semi_sync_master SONAME '
recently encountered in the production of a paging query particularly slow problem, the amount of data is about 2 million of the appearance, turned to the last page performance is very low, almost 4 seconds to come out of the entire page, need to
MySQL MasterThe first time I use a different version of MySQL will be out of sync problem, it is recommended to use the same version of MySQL from
Main my.cnf file (192.168.1.64)
MYSQLD module JoinLog-bin=mysql-bin starting a binary
There are two main ways to use MySQL for Python operations:
Native Module Pymsql
ORM Framework Sqlachemy
PymsqlPymsql is a module that operates MySQL in Python and is used almost the same way as MySQLdb.Download installationPIP3
/*Reprint please indicate the source, ID: Cherish the youth when*/Turn on MySQL service: net start MySQLTurn off MySQL service: net stop MySQLFor this reason, if there is missing hope to inform the remedy. Follow-up will also increase or decrease
Mysqldump is commonly used in MySQL database logical backups.1. Various usage instructionsA. The simplest usage:Mysqldump-uroot-ppassword [database name] > [dump file]The above command backs up the specified database to a dump file (dump file), such
Always want to analyze the source of MySQL, at the beginning do not know where to start, first from the CSV file storage start it, this is relatively simple. I am using the mysql5.7.16 version of the source code.CSV source files in the MySQL source
First of all, currently in the product environment available MySQL version (referring to 4.0.x and 4.1.x), only the InnoDB engine allows the use of foreign keys, so our data table must use the InnoDB engine.Below, we first create the following test
The storage engine for MySQL refers to the type of table. The storage engine of the database determines how the table is stored on the computer.First we can look at the storage engine supported by MySQL:mysql> show engines;+------------+---------+---
Front-end databases support many table operations and front-end databases* Directory [1] Preparation [2] multi-Table update [3] Two-Step update [4] Before connecting to [5] infinitely-level tables
In the previous blog, we introduced subqueries and
MySQL inserts or updates (similar to Oracle's merge statement), oraclemerge
If the record does not exist in MySQL, insert the statement. If the record does not exist, update the statement. You can use the following statement:
Update a field:
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