The MySQL database adds fields at the specified location:
The basic syntax of MySQL itself, here is an example.
Mysql>--Test database Add field at specified location
Mysql> drop table if exists t;
Query OK, 0 rows affected (0.06 sec)
Mysql>
Workaround One:
MySQL installation when the code,
Look at the My.ini, there's no
[MySQL]
Default-character-set=utf8
[client]
Default-character-set=utf8
[mysqld]
default-character-set= Utf8
Set up when creating a table:
DROP TABLE
Create a data table of this structure and insert 1.1 million random records for query performance testing.
After inserting 1.1 million random records, the size of the datasheet is 102MB.
Now use phpMyAdmin's own SQL query
First, get the total number of processes under MySQL user
Ps-ef | awk ' {print $} ' | grep "MySQL" | Grep-v "grep" | Wc-1
Second, host performance status
# uptime
[root@ ~]# Uptime
13:05:52 up, Min, 1 user, Load average:0.00, 0.00, 0.00
Third,
Copy the table in MySQL and copy the Old_table table to the New_table table.
1. Do not copy table data, only copy structure.
CREATE TABLE new_table like old_table
2. Through the SELECT query to copy, New_table table will lose primary key, index
MySQL Partition list section explanation
The list partition in MySQL is similar in many ways to a range partition. As with the range partition, each partition must be clearly defined. The main difference is that the definition and selection of each
MySQL Database key partitioning usage
Partitioning according to key is similar to following a hash partition, except for a user-defined expression used by the hash partition, and the hash function of the key partition is provided by the MySQL
MySQL Release results Memory code example
Definitions and usage
The Mysql_free_result () function frees the resulting memory.
If successful, returns True, or False if it fails.
Grammar
Mysql_free_result (data) parameter description
Data
1. Introduction to GrammarThere are three tables A, B, and C, and now you need to insert the values from table B and table C to find the corresponding fields in table A. For this situation, you can use the following statement to implement:INSERT
In actual demand, the contents of a certain table must be replaced in bulk, the ordinary thinking process is as follows:Select outStr_replace ReplacementUpdate WriteActually this is extremely wasteful of resources and consumes resources, MySQL built-
Errors such as "Got a packet bigger than ' Max_allowed_packet ' or" MySQL server bytes has "occur when you import the database. This is typically because the currently imported data is larger than the maximum packet size of the system's limit. The
Workaround One:
MySQL installation when the code,
Look at the My.ini, there's no
[MySQL]
Default-character-set=utf8
[Client]Default-character-set=utf8
[Mysqld]Default-character-set=utf8 set up when creating a table:
DROP TABLE IF EXISTS '
Detailed solutions are as follows:
Tip: After successful login with Windows account, right-click instance, in the Properties window, go to the security key to see that the settings in Server Authentication are "SQL Server and Windows Authentication
The data-editing tutorial in this section gives us a quick overview of how to improve the paging efficiency of MySQL data, which we will give the code as a test code that increases the efficiency of paging when large amounts of data are given.
If
1. View MySQL Database size SELECT sum (data_length) +sum (index_length)From INFORMATION_SCHEMA. TABLES where table_schema= ' database name ';The resulting result is in bytes, except 1024 is K, except 1048576 (=1024*1024) is M.
2. View the last
The difference and usage of MySQL and mysqli
MySQL is a non-holding relay function and MYSQLI is a permanent connection function. Other words
MySQL each link will open a connected process and mysqli run mysqli multiple times will use the same
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