The following script is a simple command used to execute remote database queries. I believe everyone can understand it. This is for some brothers who need to automatically check the database or execute certain statements every day, it is very
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),
View the current connection system parameters: Show variables like '% char % ';
Mysql> show variables like 'Char % ';+ -------------------------- + ----------------| Variable_name | value+ -------------------------- + ----------------| Character_
CopyCodeThe Code is as follows: Error code: 1418
This function has none of deterministic, no SQL, or reads SQL data in its declaration and binary logging is enabled (you * might * want to use the less safe log_bin_trust_function_creators variable)
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
The coalesce function can accept multiple parameters and returns the first non-null value of these parameters. If all the provided parameters are null, null is returned.The ifnull function is the same as the coalesce function, but only two
Unique query for a single table: distinct
Unique query for multiple tables: group
When 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.
The Mysql database provides two types of indexes. If they are not correctly set, the index utilization efficiency will be greatly reduced, but the problem is completely unknown.
Copy codeThe Code is as follows: create table test (
Id int not
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
Before starting the installation, first describe the difference between the mysql-5.6.4 and the lower version in the installation, from the mysql-5.5, mysql source code installation began to use cmake, so when we configure the installation directory.
In the development process, you sometimes need to remotely connect to and manage the MYSQL database on another machine. in the implementation process, you may encounter a series of problems, now, we use remote access to mysql data installed on
Apache:If the RPM package is used for installation, the installation path should be in the/etc/httpd directory.Apache configuration file:/etc/httpd/conf/httpd. confApache module path:/usr/sbin/apachectlWeb directory:/var/www/htmlIf source code is
I saw a buddy write a tutorial and record it. I am ready to lose weight at any time.
1. Delete the mysql-test folder; 2. Delete the SQL-test folder;3. Delete the debug folder under the bin directory;4. Delete all files with the. pdb extension in
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
MySql has the corresponding time type in Java.Date java. SQL. Date
Datetime java. SQL. Timestamp
Timestamp java. SQL. Timestamp
Time java. SQL. Time
Year java. SQL. Date
Analyze itRefer to MySql reference manualDate:A date. the supported range is '2
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
Backup Data method:I. SQL statements.Locks tables tablename READ; // READ lockBefore trying to LOCK a table, lock tables is not TRANSACTION-safe. It implicitly commits all active transactions and starts a TRANSACTION implicitly (for example, start
1. select the most suitable field attributeMySQL can support access to large data volumes, but generally, the smaller the table in the database, the faster the query will be executed on it. Therefore, when creating a table, we can set the field
Environment:PC: ubuntu 10.10 192.168.1.112 (master) 192.168.10.245 (slave)
MySQL: 5.1.49-1ubuntu8. 1-log
The database test already exists in the master.
First modify the mysql configuration file:/etc/mysql/my. cnf[Master]
# Author: zhxia
Copy
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