Copy codeThe Code is as follows:Select CONCAT ('drop table', table_name ,';')FROM information_schema.tablesWhere table_name LIKE 'dede _ % '; "Dede" is the prefix of the table to be deleted. After this SQL statement is executed, a series of SQL
For example, errors such as "Got a packet bigger than 'max _ allowed_packet 'bytes" or "MySQL server has gone away" occur during Database Import, generally, the data imported is larger than the maximum package size limited by the system. The default
Unique query for a single table: distinctUnique query for multiple tables: groupWhen distinct queries multiple tables, left join is still valid and full join is invalid,When using mysql, you sometimes need to query records with unique fields.
# Path to installation directory. All paths are usually resolved relative to this.Basedir = "D: \ MySQL Server 5.1 /"# Path to the database rootDatadir = "D: \ MySQL Server 5.1/Data /"
However, services are not generated because of no installation.
My previous colleagues asked me about the SQL statements in this regard. I remember it specially. After all, this is also quite common.Copy codeThe Code is as follows:Select * from (select * from member_paymentOrder by id desc) t group by member_id
Copy codeThe Code is as follows: 'mark' set ('index', 'best', 'hot ') There were few users and few people who knew about it. After a long time, I finally got a set of knowledge points.Looking at the above structure, MYSQL is not stupid. Will it
Recently, server problems have caused the company to lose a lot of website data. Smart softwares also lost a lot. I have been busy fixing data over the past few days.
When we restore a customer's data today. A consistent problem was found. Multiple
Mysql date function. The current date in the example:Curdate () is June 24, 2013.YEAR (): displays YEARMysql> select year (curdate (); + ----------------- + | year (curdate () | + ----------------- + | 2013 | + ----------------- + 1 row in set (0.01
Yesterday, BOSS issued a command to allow me to quickly generate SQL statements using word macros, so that we do not need to input a piece of metadata when creating a table. To improve efficiency and save costs:
After receiving the command, I
This error often occurs when you try to create a foreign key in mysql, which is very frustrating. You cannot create one. the error of the frm file seems to imply an error in the file permission of the operating system or other reasons, but in fact,
Set and enum data types are all string objects.Set can contain up to 64 elements, and any element in the set can be obtained. However, enum can only obtain one Wood Element in the set, which can contain a maximum of 65536 elements. That is to say,
Run the status command to view the Slow queries item. If the value is greater than 0 for a long time, the query execution time is too long.Copy codeThe Code is as follows:Reference content is as follows:Mysql> status;--------------Mysql Ver 11.18
Environment:PC: ubuntu 10.10 192.168.1.112 (master) 192.168.10.245 (slave)MySQL: 5.1.49-1ubuntu8. 1-logThe database test already exists in the master.First modify the mysql configuration file:/etc/mysql/my. cnf[Master]# Author: zhxiaCopy codeThe
On the surface of the database table, there is an index and error prevention mechanism. However, a simple query takes a long time. Web applications may run well in the development environment, but are equally bad in the product environment. If you
MySQL is so open that you can easily adjust its default settings to achieve better performance and stability. Key variables to be optimized are as follows:
Change the index buffer length (key_buffer)
Generally, this variable controls the buffer
Reference Table: student
Multi-field QueryCopy codeThe Code is as follows:Mysql> select id, name, birth from student;Query all fieldsCopy codeThe Code is as follows:Mysql> select * from student;Where specified QueryCopy codeThe Code is as
One common problem is that the offset of limit is too high, such as: limit 100000,20. In this way, the system will query 100020 entries and then discard all the preceding 100000 entries. This is a very costly operation, the query is slow. Suppose
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