Recently in the MySQL batch data test, simply summarize the problems encountered:First I was simply writing a MySQL loop to insert data into the SP, as follows:This is the process of inserting 100W data and results, you can see that the 55min +20s
First, install MySQLStart with the MySQL installation. Open HyperTerminal and enter:[email protected] ~]# yum install MySQL Mysql-serverThe installation is complete so that MySQL can start automatically with the system:[Email protected] ~]#
1. If you insert many rows from the same client at the same time, insert a few rows using the INSERT statement with multiple value. This is faster than using a single-line INSERT statement (in some cases several times faster). If you are adding data
Perhaps a lot of people will appear?? This headache of MySQL's Chinese garbled problem: resolved as follows:1. Set the default character set to UTF-8 for the newly created database firstCreate Database default character set UTF8 collate utf8_general_
MySQL configuration (some common parameters)[Mysqld]Socket =/tmp/mysql.sock# Specify a socket file for local communication between the MySQL client and server (the default is/var/lib/mysql/mysql.sock file under Linux)Port = 3306# Specify the port on
Add Create library, tableCheck which tables are available, which librariesDeleting a library Deletes a tableChange table DataMySQL login mysql-uroot-p (with password)Most of the MySQL commands are with;Add Create (da1 library name ta1 table
1.1 Creating a stored procedureIn MySQL, the basic form of creating stored procedures is as follows:CREATE PROCEDURE sp_name ([proc_parameter[,...]])[Characteristic ...] Routine_bodyWhere the Sp_name parameter is the name of the stored procedure,
Mysqldump used in MySQL database logical backup1. Various usage instructionsA. The simplest usage:[database name[dump file] The above command backs up the specified database to a dump file (dump file), such as:> Test. DumpThe generated Test.dump
1, connect MySQL database: mysql-u user name-p password;2. Creating database: Create table database name;3, delete the database: drop database name;4. Using database: Use database name;5. Create a database table:CREATE TABLE Table name (, Field name
MySQL Query CacheTo save the full result returned by the MySQL query statement, when hit, MySQL returns the result immediately, eliminating the parsing, optimization, and execution phases.How do I check the cache?MySQL Save the results in the
The version of MySQL I am applying is: 5.6.22MySQL5.5 later uses the InnoDB storage engine by default, where InnoDB and BDB provide transaction-safe tables, and other storage engines are non-transactional security tables. you can specify the engine
Write in front: indexes have a critical impact on the speed of queries, and understanding indexes is also a starting point for database Performance tuning. Consider the following scenario, assuming that a table in the database has 10^6 records, the
Multiple reasons:Http://www.jb51.net/article/23781.htmThe most common is that the data is too large,Note Optimizing SQL statements to avoid excessiveAlso change the acceptable amount of cacheAdd or modify the following variables in the my.cnf
MySQL functionstring-related functions 1 ASCII (String)Returns the ASCII code for the first letter of a string:SELECT ASCII (' A ');SELECT ASCII (' AB ');These two statements are output 65!2 BIN (Long)Returns a string in binary form of an
Binary log-related server variables:Sql_log_bin = {on| OFF} whether to log binary logs. Enable binary logging, this must be onSometimes, we want to execute some of the statements do not sync to slave, you can execute set Sql_log_bin=off, temporarily
In the MySQL database, there are mysql_install_db scripts to initialize the permissions table, and the tables that store the permissions are:
User table
DB table
Host table
Table_priv table
Columns_priv table
Proc_priv
We create a user using the DDL "create user" statement, and the new SQL user does not allow access to tables belonging to other SQL users, nor does it immediately create its own table, which must be authorized. The permissions that you can grant
The MySQL UPDATE statement is simple, updating one field of multiple data with the same value, which is generally the case:UPDATE table_name SET field = ' value ' WHERE condition;To update multiple data to different values, you can:foreach ($display
Basic concepts and architecture of Mysql Databases
Database
1. Key: The primary key is the flag column in the table. A key may consist of several columns. You can use keys as references between tables.
CustomerID is the primary key of the MERs
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