How to use SQL commands to view the MySQL database size

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),

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

MySQL time Type Selection

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

Parse the information_schema database of MySQL

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

How to unbind a local MySQL database from Ubuntu

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

Parsing php session_set_save_handler function usage (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

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

How to obtain the database size in mysql

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

Configure Apache + PHP + PHPmyadmin + MYsql in Alibaba Cloud ubuntu12.04 Environment

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

Resolve the ERROR 1005 solution when creating a foreign key in MySQL

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

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

Summary of some common php operations on mysql for database query execution

Php to operate mysql:1. $ connect = mysql_connect ('localhost', 'root', '000000') or die ('database connection failed. 'Mysql _ error (); link to mysql.2. mysql_select_db ('database', $ connect) Select the connected database.3. mysql_query ('set

How to parse Mysql multi-table queries

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

MySQL timestamp automatic update Time Sharing

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 statement usage and Optimization

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

Resolve the sum of non-repeated mysql Field Values

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

How to use memory in mysql Cache

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

Usage of MySQL memory (Global cache + thread cache)

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 +

Analysis on the scheduling priority and change of mysql statements

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

Differences between max_connections and max_user_connections in mysql

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;

Total Pages: 3233 1 .... 2152 2153 2154 2155 2156 .... 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.