Enter installation directory .../bin/mysql.exe
CD Replacement directory dir lists all files in the current directory
The c:\vesa\...\a> angle bracket is expressed in the A folder of the C/vasa/.
CD space ... Indicates an up-level directory
Creation of tables
CREATE TABLE ' Lee ' (
' id ' int ' () not NULL auto_increment,
' name ' char (#) DEFAULT null,
' birthday ' datetime D Efault NULL,
PRIMARY KEY (' id ')) engine=innodb DEFAULT Charset=utf8
Data insertion:
Set up 2 test tables and create a unique constraint on the ID column.
Mysql> CREATE TABLE test1 (ID int,name varchar (5), type int,primary key (ID));
Query OK, 0 rows affected (0.01 sec)
Mysql> CREATE TABLE test2 (ID int,name varchar (5), type
Statistical averagethe SELECT AVG () from syntax is used to average statistics from data tables.Grammar:
SELECT AVG (column) from Tb_name
This SQL syntax is used to count the average of a numeric type field, and the AVG () cannot be
There are many kinds of programs, I would simply say here:
1. Into outfile
Copy Code code as follows:
SELECT * FROM MyTable
into outfile '/tmp/mytable.csv '
FIELDS terminated by ', '
Optionally enclosed by ' "'
LINES
This article has shared several kinds of replication table structure, table data examples, details, please see below.
1. Copy table structure and data to new table
CREATE Table New Table select * from old table
This method copies all the contents
In the process of development, avoid encountering disgusting garbled, or a series of problems caused by garbled characters. Garbled is the character set reason in general and logic is not too much relationship, that is, the whole system big
You can specify in the configuration file the initial execution of the SQL file after MySQL startup, and its syntax is:Specify under [mysqld] or [Server]:Init-file=d:\mysql-5.5.28-winx64\abc.sql, with a specific SQL file value behindNotice that the
To summarize Lengbei in one sentence is to stop the database services, such as mysql,oracle, and then use a copy, package, or compression command to back up the data directory. If there is an exception to the data, you can restore it through backup
Introduction:
Because the MySQL database is too large, the default installed/var disk can no longer accommodate the newly added data, there is no way, can only find ways to transfer the data directory.
Let me organize the following steps to
I believe that we use MySQL have overweight experience, if the reload MySQL is basically in the last step through but, unless the operating system, the reason is that the system's registry is not deleted clean. Here are some of the lessons I've
MySQL implements synchronization of two tables through triggers
Currently, the local test was successful.
Suppose there is a table table2 (ID, val) under table table1 (ID, Val) under the local two databases A and b,a.
Suppose you want the data to be
Start learning the database today, because I am not very cold to Microsoft, so do not use his home product originally wanted to install Oracle, but too big, look afraid for me this kind of like basics, MySQL is a good choice, about the big theory of
MySQL large table repeating fields How do I find it? This is a lot of people have encountered problems, below teach you a MySQL large table repeat field Query method for your reference.
There is a large table in the database, and you need to find a
Workaround:
The first step: to restore the database and tables are UTF8 format (recommended UTF8, of course GBK or gb2312 also line)
Copy Code code as follows:
CREATE DATABASE ' Shegongku ' DEFAULT CHARACTER SET UTF8
CREATE TABLE '
The situation is the case: there are now two tables, a team table and a people table, each people belonging to a team,people with a field team_id.
The following is a table statement:
Copy Code code as follows:
CREATE TABLE T_team
Mysqltuner Download Address: Http://github.com/rackerhacker/MySQLTuner-perl
Mysqltuner Use Method:Downloading and using Mysqltuner is actually a very simple process:
wget mysqltuner.plPerl mysqltuner.pl
If you ' d rather not invoke the Perl every
Note: the Row_count () in MySQL can return the number of rows affected by the previous SQL Update,delete,insert operation.
Test on MySQL (database version: 5.1.22):
1. Create a database table:
Copy Code code as follows:
CREATE TABLE
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