Environment:The MySQL database version on the master and slave servers is 5.1.34.Host IP: 192.168.0.1Slave IP Address: 192.168.0.21. MySQL master server configuration1. Edit the configuration file/etc/my. cnf# Make sure it is as downstreamServer-id =
1. The configuration is enabled.Linux:AddLog-slow-queries =/var/lib/mysql/slowquery. log (specify the location where the log file is stored, which can be empty and the system will give a default file host_name-slow.log)Long_query_time = 2 (the time
A sample SQL statement for exporting CSV data in MySQL is as follows:
SQL codeSelect * from test_infoInto outfile '/tmp/test.csv'Fields terminated by ', 'optionally enclosed by' "'escaped '"'Lines terminated by '\ r \ n ';
Select * from
1. concat () function1.1 The concat function of MySQL can connect one or more strings, suchMysql> select concat ('10 ');+ -------------- +| Concat ('10') |+ -------------- +| 10 |+ -------------- +1 row in set (0.00 sec) Mysql> select concat ('11', '
I checked a lot of information and tried some. The final method is as follows:
1. Export mysql table definitions (no data)Mysqldump -- no-data [dbname]> dbdef. SQL
2. Use mysql2postgres to convert the script to pgsql
3. The script generated above is
Mysql prompt is a very useful command. You may be very worried about the database you are operating on when you operate mysql through the command line. At least I have struggled with it, maybe you will say that I don't know if I just run a command.
MySQL experience 10-1-transaction 1. In the MySQL environment, a transaction is composed of one or more SQL statements as a separate unit. Each SQL statement in this unit is mutually dependent, and the Unit as a whole is inseparable. If a statement
Slow query caused by MySQL prefix indexes the front-end time is a DB-related project. alanc reports that using indexes is much slower than using indexes, which is a little ruined. So I followed up and used explain to look at two different query
MySQL disk replication technology-DRBD: advantages and disadvantages comparison, precautions and Best Practices DRBD is the block-level synchronous replication technology implemented by the kernel module. The synchronization level here can be
After mysql use db, it is very difficult to solve a mysql instance that you usually use. After using db, it is always very difficult to press Enter. It takes 1 s to return the result. I think there is something strange, I opened the general log and
Mysqldump is a common mysql database tool. We often use it for data and backup, for example, data import and export. This article introduces the code for exporting the most basic database and exporting tables.]
# Mysqldump Database Name> Database
Mysql tutorial detailed description of left join SQL left join statementsMysql left join query is a method of joint query. That is to say, two related tables are joined together for query in this way, which makes it easier to call data and avoids
I. insert and replace
Both insert and replace statements insert new data into the table. The syntax of these two statements is similar. The main difference between them is how to process repeated data.
1. General insert usage
The insert statement
Mysql obtains the first day of the quarter, the first day of the month, and the first day of the week.
On the first day of this quarter, you can convert the string to the date. There are many methods, including aliases (synonyms) of the same
This article introduces how to use group by sorting in mysql to obtain the most recent records in a record group. For more information, see.
Mysql group by: sorts the records with the largest time in each record.
Test SQL
Create table if not exists '
1. Does MySQL 5.1 storage programs and functions work for replication?
Yes, the standard behavior executed in the storage program and function is copied from the master MySQL server to the slave server.
2. Can the stored programs and functions
The advantage of parallel query is that it can process query jobs through multiple threads, thus improving the query efficiency. The SQL Server database provides the parallel query function for database servers with multiple CPUs to optimize the
Recently, in an internal system of an enterprise, the database uses SQL2000. To ensure data security, you need to back up data after work every day and notify the administrator about the backup by email. It is very easy to back up the database. You
On the server where mysql is installed locally, open cmd and cd to the bin directory under the mysql installation directory. Multiple executable files can be seen in the bin directory, mysqladmin can be used to remotely close the mysql service.
The
So on the InternetAfter checking, let's talk about it here:1 = 1 permanent, 1 <> 1 permanent false.1 <> 1 usage:Used to retrieve only structures without dataFor example:Create table table_temp tablespace tbs_tempSelect * from table_ori where 1 <>
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