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),
In practice, you need to replace the content of a field in a table in batches. The general thinking process is as follows:
Select
Replace str_replaceUpdate write
In fact, this is a waste of resources and resource consumption. MySQL has a
Generally, the Master/Slave Mechanism Based on LAN can meet the requirements of 'realtime' backup. If the latency is high, first confirm the following factors:1. network latency2. Master Load3. Slave LoadThe general practice is to use multiple slave
Install mysql plug-inNpm install mysql@2.0.0-alpha7
Location after successful installation:C: \ Users \ User Name \ node_modules \ mysql
How to view the readme. md FileHttp://daringfireball.net/projects/markdown/dingus
Small mysql example
Var mysql =
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 reason is that the primary key must be unique, that is, there may be duplicates in the database with the current restored database. a restriction that Foreign Keys shoshould be uniquely named throughout the database, an effective method is to
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
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
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
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
Drop user deletes all user information, while delete only deletes the user table. Other information, such as the information in the db table, still exists.
If you create a user with the minimum permission after the delete operation, the user will
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
I have been using mysql master/slave for some time. This architecture cannot fundamentally make up for the performance problems caused by data structure design mistakes. Chat is better than nothing.
In master/slave Mode, data synchronization is fast.
We often encounter the problem of setting the current time as the default value in MySQL. The following describes how to set the current time as the default value in MySQL.Database: test_db1Create Table: test_ta1Two fields: id (auto-increment and
I have read a lot of questions about mysql. sock on the Internet before, but I didn't pay attention to the significance of this issue until I encountered the same problem in my mysql. It's confusing ......
Copy codeThe Code is as follows: zhouqian @
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 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