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
The innodb Engine differs greatly from the MYISAM engine. In particular, its data storage format.For the innodb data structure, we must first solve two conceptual problems: the shared tablespace and the exclusive tablespace.What are shared and
To know the size of each database, follow these steps:1. Enter the information_schema database (storing information about other databases)Use information_schema;2. query the size of all data:Select concat (round (sum (data_length/1024/1024), 2), 'mb'
I. Differences in Common commands of different versions
Show innodb status \ G mysql-5.1
Show engines innodb status \ G mysql-5.5
User @ '%' about grant authorization mysql-5.5 does not contain localhost
Ii. Main differences between MySQL 4.1/5.0/5.
When I used the mysql database in my experiment today, I forgot my password and asked me to find it for a long time. Now I want to introduce my own method: I used mysql functions for testing.Copy codeThe Code is as follows:Mysql> select user,
The prompt command displays the current user, database, time, and other information at the mysql prompt.Copy codeThe Code is as follows:Mysql-uroot-p -- prompt = "\\ u \\ h :\\ d \\ r :\\ m :\\ s>"After the setting is successful:Copy codeThe Code is
1> query data in addition to the first three data tables.
At first, I thought of this statement.
SELECT * FROM admin WHERE userid not in (SELECT userid FROM admin order by userid LIMIT 3) order by userid DESC
But it will reportThis version of MySQL
Recently, many SQL statements are written in the project, and variable assignment is often used, and I use SET and SELECT to achieve the effect.What is the difference between the two? When and which one?After online queries and personal exercises,
Different SQL statement writing methods often bring about great performance differences. How can we know the overhead of SQL query execution? MySQL provides the EXPLAIN keyword for us. When you add the EXPLAIN keyword before your select statement,
1. Each client connection is divided into a thread belonging to the server process. The corresponding queries of the connection are all processed by this thread.
2. The Server caches the thread. Therefore, no threads are created or destroyed for
You can obtain an alias for the table and field during query. This alias can replace the specified table and field.
Alias for tableCopy codeThe Code is as follows:Mysql> SELECT * FROM department d-> WHERE d. d_id = 1001;+ ------ + ----------- + -----
MySQL master/Master synchronization Configuration
Server Name
IP
System
MySQL
Odd.example.com
192.168.1.116
Rhel-5.8
5.5.16
Even.example.com
192.168.1.115
Rhel-5.8
5.5.16
Assume that the
Search for subdomains
For example, jb51.net searches for www.jb51.net, jb51.net, and host.jb51.net.
If mysql is used with like, the efficiency is very low. millions or even tens of millions of data cannot be used, so sphinx is used.
Many problems
This is the case: there are two tables, team table and people table. Each people belongs to a team and there is a field team_id in people.
The following table creation statement is provided:
Copy codeThe Code is as follows:Create table t_team(Id int
The development environment of a company is usually deployed on the Intranet, and then there will be public servers for developers and tests. Therefore, there is often a need to connect to the server through ssh or a local mysql client, in my
This was a long time ago problem. Last year I wrote a WP plug-in: WordPress voting plug-in Ludou Simple Vote. Some users need a Vote ranking, therefore, you need to use an SQL statement to read the list of articles sorted by score.
The Ludou Simple
The default encoding of the mysql database is not UTF-8.
After installing mysql, start the service and log on to the mysql database. Run the show variables command to view the default encoding of the mysql database:
The character set of the
1. InstallationCopy codeThe Code is as follows:./Configure -- prefix =/usr/local/apache2 -- enable-so -- enable-rewrite -- enable-ssl
Apache now has a pseudo-static function called built-in pseudo-static.
2. If there is no -- enable-rewrite
Introduction Xtrabackup is a mysql database backup tool provided by percona. According to the official introduction, Xtrabackup is the only open-source tool in the world that can perform hot backup for innodb and xtradb databases. Features:(1) The
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