In the daily work, will be a simple use of MySQL, so the common Command operation summary, commonly used in the following ways
Use of the mysqldump command:
Backing up and exporting databases
Mysqldump-h database_ip-u username-p--opt databasename
A useful common statement.
MySQL Display database or table:
The following are the referenced contents:Show databases;//can then use database_name;Show tables;
MySQL Change table name:
ALTER TABLE table_name rename new_t;
MySQL Add columns:
This paper is a fast and precise grasp of the SELECT statement in MySQL database.
The basic syntax for a SELECT statement in MySQL is:
The following is a reference fragment:
SELECT [Straight_join] [Sql_small_result]
[Sql_big_result]
Objective
In order to ensure consistent integrity of data, there is a locking mechanism in any database. The quality of locking mechanism should be directly thought of the concurrent processing ability and performance of a database system, so the
MySQL WIN10 decompression
Download decompression
Mysql: Version 5.7.13 download link (through this official website Zip link can be downloaded directly, no longer registered Oracle account)
Extract Mysql-5.7.13-winx64.zip to any directory, I
1. Install ApacheYou can install Apache by entering the following command in the terminal:
sudo yum install httpd
sudo means what to do with the root user. To click on the Y to confirm the download installation, very convenient.Then use
Keepalived
Due to the use of mysqlcluster in the production environment, high availability load balancing is required, and keepalived+haproxy is provided here for implementation.
The main function of keepalived is to realize the fault isolation of
several character sets involved in MySQL
Character-set-server/default-character-set: Server character set, by default.
Character-set-database: Database character set.
Character-set-table: Database table character Set.
Priority increases in order.
Nesting Queries Poor optimization
As I mentioned above, a table query is more efficient than a nested query, regardless of the particular situation. Although the two queries express the same meaning, although your plan is to tell the server what to
MySQL MySQL can be connected to the Web through PHP in two ways, one via PHP mysql-related functions, the other through PHP's ODBC-related functions
The related functions are as follows:
MySQL function
Mysql_affected_rows: Gets the number of
For most Web applications, databases are a very basic part. If you're using PHP, you're probably also using a significant part of the Mysql-lamp series.
For many beginners, using PHP can easily write code with specific functionality within a few
mysql| Compile | Optimize MySQL at compile time
If you install MySQL from the source code, note that the compilation process will have an important impact on the performance of future target programs, different compilation methods may get similar
mysql| Encryption | algorithm | arithmetic
The previous section of the summary describes how to encrypt/decrypt using the XOR operation, which is used to encrypt the user's logon information. Based on the principle of the XOR encryption algorithm
mysql| Stored Procedures | tutorials
Author: MySQL AB; translation: Chen Bong
Error Handling Exception Handling
All right, now we're going to talk about exception handling.
1. Sample Problem:log of failures Problem example: Fault logging
When an
At present, there is no database products specifically for the cross-IDC optimization, in theory by the industry that the best solution is based on the Paxos protocol (temporarily only Google made the implementation, Google F1), today only discusses
Pick to: This paper describes the problemof MySQL DDL , thept-online-schema-change of the work principle , and the actual use of The pt-online-schema-change tool modifies the 160 million-level data table structure on-line in the production
A Linux environment to monitor MySQLZabbix Serverbring your own.MySQLPlugins to monitorMySQLdatabase templates, only need to be configured wellAgentclient, and then inWebadd a template to the host to the end of the lineMonitoring project:Number of
MySQL insert when the record does not exist, update when the record exists, mysqlinsert
There are basically three solutions on the Internet.
First:
Example 1: insert multiple records
Suppose there is a clients table with the primary key of
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