This article attempts to describe the optimal selection from the perspective of the schema and index created by the data table. Optimal Data Types
The smaller the data, the better. Select the minimum data type that meets your needs. By saving
1. Download
Here:Http://dev.mysql.com/downloads/mysql/5.1.html SelectMysql-noinstall-5.1.xx-win32.zipDownload
2. decompress the package to a folder.
3. Install
Change my-huge.ini Copy to c: \ windows and rename it my. ini
In cmd(Run
Call the cursor.exe cutemany () function in the mysqldb Python library to complete batch processing.
Today, this function is used to complete batch insertion.Routine:Def test_insertdb ():Conn = database. Connection (host = options. mysql_host,
When MySQL ServerWhen a Crash is damaged for unexpected reasons, you must perform disaster recovery. If you have regular database backup, disaster recovery should be much easier.The copied data can be restored, but this will still cause loss of some
The MySQL server adopts a modular style, and each part remains relatively independent, especially in the storage architecture. Storage EngineManage data storage and MySQL indexes. Through the defined API, the MySQL server can communicate with the
What command should I use to view the Mysql table structure? The following describes the commands for viewing the Mysql table structure in detail. If you have encountered a similar problem in the Mysql table organization, you may wish to take a look.
1. log on to the mysql monitor command: cmd>Mysql-u root-pThen press enter to enter the password
2. the mysql configuration file is my. ini under the installation directory.
The slave database crashes directly, and the root user cannot log in.
User-friendly MySQL replace into usage (enhanced version of insert)
When inserting data into a table, you often encounter this situation: 1. First, determine whether the data exists; 2. If the data does not exist, insert the data; 3. If the data
Query is the core of the database. The following describes how to implement Mysql multi-Table query. If you have encountered any problems in Mysql multi-Table query, take a look.
Mysql multi-Table query:
CREATE TABLE IF NOT EXISTS contact(
I often encounter the need to export data from a database to an Excel file. Using some open-source class libraries, such as PHPExcel, is indeed easy to implement, but it does not support a lot of data, it is easy to reach the PHP memory usage limit.
Share a function written yesterday. The purpose is to find that the given time is the nth week of the month.
[SQL] View plaincopy
Delimiter $
Use't _ girl $
Drop function if exists 'weekofmonth' $
Create definer = 'root'
BlackHole: The black hole engine. Any data written will disappear and is used to record the relay storage of binlog replication! How to install: Use the configure command with the -- with-blackhole-storage-engine option when installing MySQL. The
Create procedure, Create function
Below are their formats:Create proceduresp_Name ([proc_parameter])Routine_body
Here, the parameter type can be in out inoutt, which means the same as the word, and IN indicates the passed parameter,"OUT" indicates
In MySQL, order by has two sorting methods:
1. Use ordered indexes to obtain ordered data
2. File Sorting
When using explain to analyze and query,Use ordered indexes to obtain ordered data displayUsing index. File Sorting displayUsing filesort.1.
1. Optimize SQL
1) Use show status to learn the execution frequency of various SQL statements.
Show status like 'com _ %'How many times Com_select and Com_insert are executed2) analyze inefficient SQL statements through Explain3) create an
Original article: http://lxh71105321.blog.163.com/blog/static/23988844200901394611940 /#
For a long time, I have been wondering why mysql Data insertion slows down when I use the MYISAM engine. I am puzzled
Myisam does not support transactions.
The main solution is as follows:
1. mysql's authorized user permissions must be % instead of @ localhost
2. The connection characters used by jsp to connect to the database using the jdbc driver should be considered as remote access.
3. Remember: @ %
A few days ago, I encountered a strange problem in the management system. Today I have the opportunity to install the MySQL environment to reproduce this problem. Because it is not the most primitive environment, it may not be completely reproduced,
Reprinted from: http://hi.baidu.com/silvanote/blog/item/a5aab77996d458f90bd18748.html
To achieve this, the assql class library can perform some basic data operations even though the current version is not stable.
Organize some of its instances and
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