Method 1: Use mysqldump -- no-data to export the SQL statement for creating the database and table, drop the database, create the database, execute the exported SQL file, and create the table. Method 2: generate sqlmysql-n-s information_schema-e
Create two user tables, user and user2. The table structure is the same, but the user table uses the InnoDB Storage engine, while the user2 table uses the MyISAM storage engine.
-- Table "user" DDL Create Table ' User '('Id' Int ( 11 ) Not
ArticleDirectory
Configure master
Configure slave
Connect master and slave
High Availability MySQL p10 MySQL master-slave Replication
MySQL replication is often used in the following environments:
1. Avoid
By default, httpd and MySQL are not started,
For example, if you directly use the MySQL command => 〉
Can't connect to local MySQL server through socket '/var/lib/MySQL. Sock'
A: Use YaST to start the desktop directly in system> service.
B:
First, disable MySQL
Use the command line to start MySQL (usually find the mysql. ini file)
On Windows, you can view the MySQL process parameters in the mysql. ini file. Click here for details.
Add the -- skip-grant-tables parameter at the
I. MySQL
Only the Union set does not have the keyword of the intersection difference set
Two-Table Structure
A B
Three-Union
3.1 union does not contain duplicate data
SelectNameFromAUnionSelectNameFromB;
3.2 Union all
This problem is often encountered: the database has a large access volume and needs to be optimized from the SQL aspect. Developers often ask: Can you see which SQL statements are executed frequently? Return: No. You can only view the currently
eq_ref one row will be read from this table for each combination of rows from the previous tables. other than the const types, this is the best possible join type. it is used when all parts of an index are used by the join and the index is a
1
How to implement the following SQL query in MySQL(Select S. NameFrom student s, transcript tWhere S. studid = T. studid and T. crscode = 'cs305 ')Intersect(Select S. NameFrom student s, transcript tWhere S. studid = T. studid and T. crscode =
1. Non-conventional implementation of collection class in http://www.blogjava.net/rox/archive/2006/09/01/67008.htmlmysql
MySQL only supports Union (Union) set operations. It seems that it is only available after 4.0;However, the intersection
In the past, Oracle was rarely used for its collation method. However, in MySQL, problems may occur if you do not pay attention to this.
The problem is as follows:
A test table. The character set uses latin1.
Select to_id from test where to_id
Some time ago, a very advancedProgramI was surprised to ask what I call index. I think it will not be a small result, because there are thousands of developers (probably most of them using MySQL) none of them have received formal training on
Http://lib.xiaop.net/article/mysql-optimization/
1. select the most suitable field attribute
MySQL 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.
Friend host (Windows2003 + IIS +PHP+MySQL) Recently MySQL service process (mysqld-nt.exe)CPUThe usage rate is always 100%. This host has about 10 databases, which are called for 10 Websites respectively. According to a Friend test, lead to mysqld-nt.
MySQL --------
Select a. dname,
Max (If(B. Mon ='February', B. YJ,0) In March,
Max (If(B. Mon ='February', B. YJ,0) In March,
Max (If(B. Mon ='February', B. YJ,0) February
From T2 a left join t1 B on A. Dep = B. Dep
Group by dname
FromHttp://androider.javaeye.com/blog/352332
Meanings of foreign key constraints on subtables:If no candidate key is found in the parent table, insert/update is not allowed in the child table.
meanings of foreign key constraints on parent
It is fast enough to run a common MySQL with a small amount of data and traffic. However, when the data volume and traffic volume increase sharply, it is obvious that MySQL is slow or even down, we need to consider optimizing our MySQL.
From: http://www.php100.com/html/webkaifa/database/Mysql/2011/0710/8418.html
In the past, this site introduced "20 + best MySQL performance optimization experiences". Today, we will introduce six useful MySQL SQL statements, many may use
1. MySQL Common commands
Create Database Name; Create a database
Use databasename; select database
Drop database name directly deletes the database, no reminder
Show tables; displays tables
Describe tablename; Detailed description of the
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.