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),
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
Inter-Domain type:Try to use the timestamp type, because its storage space only needs half of the datetime type. For data types that only need to be accurate to a specific day, we recommend that you use the date type because its storage space only
The information_schema database is generated after mysql 5.0. A virtual database does not exist physically.
The information_schema database is similar to the "Data Dictionary" and provides a way to access database metadata, that is, Data. For
Problem:In Ubuntu, you have added a MySQL account, granted full database operation permissions, and allowed the database to access external links.However, you still cannot remotely access the MySQL database.
Cause:In Ubuntu, the default MySQL
Copy codeThe Code is as follows: /* ============================ File description ========== ======================================
@ Filename: session. class. php
@ Description: The database saves the online user session to implement the online
Copy codeThe Code is as follows: Select CONCAT ('drop table', table_name ,';')
FROM information_schema.tables
Where table_name LIKE 'dede _ % ';
"Dede" is the prefix of the table to be deleted. After this SQL statement is executed, a series of
1. view the mysql database sizeSELECT sum (DATA_LENGTH) + sum (INDEX_LENGTH)FROM information_schema.TABLES where TABLE_SCHEMA = 'database name ';The result is in bytes. Except 1024 for K, except 1048576 (= 1024*1024) for M.
2. view the last mysql
In this tutorial, you must modify the related IP addresses in your environment.Update apt-get before use, because the server is basically a bare SystemApt-get update;Apt-get upgrade;1. We use the root account for installation. First switch to the
When creating a foreign key in MySQL, an ERROR is prompted, but only the simple information is prompted: ERROR 1005 (HY000): Can't create table 'db _ qxztc. qx_userssssnew' (errno: 150 ). It cannot solve the problem at all.
To view the detailed
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
Query is the core of the database. The following describes how to implement Mysql multi-Table query. If you have encountered any problems in Mysql multi-Table query, take a look.
Mysql multi-Table query:
Copy codeThe Code is as follows: create
Generally, the table has a Create date Field, and other databases have default options. MySQL also has the default value timestamp. However, in MySQL, the value of timestamp is updated even if it is inserted or modified!
In this way, it is not the
MySQL Order By keyword is used to classify the data in the record.MySQL Order By Keyword ClassificationOrder by keyword is used to classify the data in the record.
Copy codeThe Code is as follows: SELECT column_name (s)
FROM table_name
Order by
When using mysql, you sometimes need to query records with unique fields. Although mysql provides the keyword distinct to filter out redundant duplicate records, only one record is retained, but it is often used to return the number of records that
2 points firstEnabling cache also brings about overhead, mainly in the following aspects:Before starting the query, you must check the cache.If the query is cached but not in the result set, saving the data after the result is generated will incur a
First, let's take a look at the formula. MySQL memory is divided into two parts: global memory and thread memory (not all, but the most influential part ):
Copy codeThe Code is as follows: per_thread_buffers = (read_buffer_size +
The default Scheduling Policies of MySQL can be summarized as follows:· Write operations take precedence over read operations.· Write operations on a data table can only occur once at a time point, and write requests are processed in the order they
Max_user_connections has been mentioned in the mysql manual. It is used to restrict user resources. How can we limit user resources? A small test is conducted here.
First, check the value of the global variable.Mysql> select @ max_user_connections;
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