Reset MySQL Self-add auto_increment initial valueNote that existing data is deleted by using any of the following methods.
Method One:
Delete from tb1;
ALTER TABLE tbl auto_increment = 100;
(Benefits, you can set auto_increment to start with any
SELECT * FROM table limit m,n where M is the index at which the record starts, from 0, N is the beginning of article M, and N is taken.
Copy Code code as follows:
MySQL (root@localhost:test) >select * from Total;
+----+-----------------+-
There is a statistical need for IP classification statistics, MySQL provides Inet_aton () and Inet_ntoa () function process processing.The official manual can be viewed in detail.
Inet_aton (expr)Gives a point address representation of a network
Poor SQL query statements can have a serious impact on the operation of the entire application, not only consuming more database time, but also impacting other application components.
As with other disciplines, optimizing query performance largely
We know that we can put a large number of records of MySQL big table according to the primary key, Time field, conditional field, etc. into several tables and even saved in several servers.The only problem is that the query is cumbersome across
There are indexes and error-proofing mechanisms on the surface of database tables, but a simple query can take a long time. Web applications may work well in the development environment, but they are equally bad in the product environment. If you're
Last night received customer service mm phone, a user feedback database response is very slow, the phone received load abnormal alarm, boarded the host found that a large number of SQL execution is very slow, some more than 10s execution
Environment:
Pc:ubuntu 10.10 192.168.1.112 (master) 192.168.10.245 (slave)Mysql:5.1.49-1ubuntu8.1-logDatabase test already exists in master
First Modify MySQL configuration file:/etc/mysql/my.cnf[Master]
#author: Zhxia
Copy Code code as
There are many hint of table joins that can be specified in Oracle: ordered hint instructs Oracle to connect according to the order of the tables following the FROM keyword, leading hint instructs the query optimizer to use the specified table as
1. Create a column
ALTER TABLE tablename add COLNAME type NOT null default ' 0′;
Cases:
ALTER TABLE Mmanapp_mmanmedia add appid_id integer NOT null default 372;
2. Delete Column
ALTER TABLE tablename drop
Problem
User work Order question: The same statement, only the last limit line number is different. Oddly, the performance of limit 10 is about 10 times times slower than the Limit 100 statement.
Hide User table information, statements, and the
Occasionally to use PHP to do some MySQL database operation Test, write yourself too troublesome, the results of the search generally contains a lot of useless code, here will be PHP MySQL operation to do a summary, I hope that in the future when
Most use WordPress built site, after the table are MySQL database, often we need to customize the function of WordPress, here we list 10 most useful wordpress database query, you need a database management tools, such as phpMyAdmin or NAVICAT, etc.
The primary key in a table originally was an int self-growing type,Because business changes require an int to be converted to a CHAR-type primary key. Also, because the data already exists in the original table, you cannot delete the table rebuild,
Recently and Sobin are doing a project for a boutique course, because a fixed ID is used as an association between tables, so after inserting data into the previous table, you pass the ID of the inserted data generation to the next table. Studied a
First of all, I used the version number of MySQL is 5.5.17, recently encountered the problem is in eclipse through JDBC to the database to write Chinese data, in the database is displayed?? That garbled, in order to solve this problem, engaged in a
If you want to partition on a table that has already been built, MySQL prompts for an error if you add the partition using alter:
Copy Code code as follows:
ERROR 1505 Partition Management on a not partitioned the table is not
Query is the core of the database, the following for you to introduce MySQL multiple table query How to achieve, if you are in the MySQL multiple table query has encountered problems, may wish to see.
mysql multiple table query:
Copy Code
The default scheduling policy for MySQL can be summarized as follows:· Write operations take precedence over read operations.· Writes to a data table can occur only once at a time, and write requests are processed in the order in which they arrive.·
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