Batch Delete SQL statements of a specified prefix table in MySQL

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

How to modify the max_allowed_packet parameter of the mysql database

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

Parsing mysql: removing duplicate records for single-Table distinct and multi-Table group by queries

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.

How to register and uninstall a service in green mysql

# 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.

Group by xxx)

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

SQL operations for MYSQL SET Fields

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

MYSQL sorts the distances between two longitude and latitude dimensions in a descending order.

Copy codeThe Code is as follows:Select *, (2*6378.137 * ASIN (SQRT (POW (SIN (PI () * (111.86141967773438-lat)/360), 2) + COS (PI () * 33.07078170776367/180) * COS (lat * PI ()/180) * POW (SIN (PI () * (33.07078170776367-lng)/360), 2 )))) as juli

How to handle "Incorrect key file for table" in mysql

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

In-depth explanation of mysql YEAR () MONTH () DAYOFMONTH () Date function

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

How to Use word vb macro to generate SQL

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

Parsing MySQL foreign key Association error-errno: 150

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,

Introduction to set and enum in mysql

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,

Discussion: How to query the currently running SQL statements in MySQL

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

In-depth explanation of using parameters for table names in mysql stored procedures

BEGIN Declare date_str varchar (8 );Declare table_prefix varchar (20 );Set table_prefix = 'mail _ rare_visit _';Set date_str = DATE_FORMAT (CURRENT_DATE (), '% Y % m % D ');Set @ table_name = concat (table_prefix, date_str );Set @ s = concat

Detailed description of synchronization configuration based on MySQL Master Slave

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

Six tips for MySQL database performance optimization

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 Query Optimization-detailed explanation of adjusting internal variables

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

Application of basic query for MySQL notes

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

How mysql converts a column value to a column

Copy codeThe Code is as follows:-- Create a databaseCreate table 'rate '('Uname' VARCHAR (300 ),'Object' VARCHAR (300 ),'Score 'varchar (300)); -- Insert dataInsert into test. rate (uname, object, score)VALUES ('aaa', 'China', '67 '),('Aaa', 'Math',

Example of optimizing mysql limit offset

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

Total Pages: 3233 1 .... 2849 2850 2851 2852 2853 .... 3233 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.