. mysql Tutorial
Download the MySQL for Linux RPM package on the following page
http://www.mysql.com/downloads/down...3.52-1.i386.rpmhttp://www.mysql.com/downloads/down...3.52-1.i386.rpm
Save to/home/tmp Directory
List of commands:
Master MySQL Settings
1, edit the main MySQL server MySQL configuration file my.cnf, under [mysqld] Add the following parameters:
Log-bin=mysql-bin//open MySQL binary log
Server-id=1//server ID cannot be duplicated
BINLOG-DO-DB=DZX2//need to
As a site or server operation personnel, the site backup and restore operations must be skilled. MySQL database Export and import operations are essential, for the general user, may use more than phpmyadmin such a visual interface, but this
Export the Mysqldump tool that you want to use with MySQL, basic usage:
The code is as follows
Copy Code
Shell> mysqldump [OPTIONS] database [tables]
If you do not give any tables, the entire database will be
Today I saw my colleague accidentally deleted the user table in the MySQL database. Fortunately, there is a bin-log of MySQL on the log, so that the log can be used to restore previously backed up data. The specific operation is done by mysqlbinlog
Method One:
My common practice is to add a Delete identity field to the database.such as: isdel=1 so that the code deleted the field
Method Two:
Direct restriction of MySQL DELETE statement deletion
Add parameter-u when starting MySQL
The reason is that many times, in order to secure, do not allow MySQL management tools to connect the formal environment on the line, in this case, you can not rely on the MySQL management tools to transform the code to solve the problem of Chinese
Indexes are used to quickly find rows that have a specific value in a column. Without indexing, MySQL must start with the 1th record and read through the entire table until the relevant rows are found. The larger the table, the more time it takes.
Mysql> SELECT * from pet WHERE name like "b%";
To find the name ending with "FY":Mysql> SELECT * from pet WHERE name like "%fy";
To find the name that contains a "w":Mysql> SELECT * from pet WHERE name like "%w%";
To find names that contain
Methods of optimizing MySQL Database
To create a large number of tables in a database, it is slow to perform open, close, and create (table) operations. 2:mysql using Memory A: the keyword cache (key_buffer_size) is shared by all threads B:
1. Storage required for numeric type column types TINYINT 1 bytes SMALLINT 2 bytes mediumint 3 bytes INT 4 bytesInt (m) in the integer data type, m represents the maximum display width.in int (m), the value of M has nothing to do with how much
Unable to terminate MySQL service on local computer error 1053: The service did not respond to startup or control requests several times,
discuz! Info:can not connect to MySQL server
Time:2010-7-8 11:23pmScript:/index.php
Error:lost connection to
Now let's put aside the problem with the MySQL storage engine. If your MySQL table is InnoDB and you don't need to worry about how InnoDB works, you've set it up, but you're not sure if it's going to work. These questions will be mentioned below.
What is InnoDB BUFFER POOL
Computers use most of their memory to improve the performance of frequently accessed data. This is what we know about caching, which is a very important part of the system because accessing the hard disk can be as slow as
Alter table: add, modify, and delete TABLE columns, constraints, and other TABLE definitions.View column: desc table name;Alter table t_book rename to bbb;Add column: alter table name add column name varchar (30 );Delete column: alter table name
4. Maximum sorting of query data (only one statement can be used for writing)Create table hard (qu char (11), co char (11), je numeric (3, 0 ))Insert into hard values ('A', '1', 3)Insert into hard values ('A', '2', 4)Insert into hard values ('A', '4'
MySQL cannot be mentioned in PHP, But MySQL must be mentioned in PHP. The rapid rise of PHP is inseparable from MySQL, and the wide application of MySQL is also related to PHP.The following is a detailed analysis of MySQL-related functions in PHP4
Max queries per hour --- maximum number of QUERIES PER HOURMax updates per hour --- maximum number of UPDATES PER HOURMax connections per hour --- maximum number of CONNECTIONS PER HOURIn Win, you can modify my. ini:4.0 and later versions are
Step 1: Prepare the database. Install the data source (I have been charged for several days). First, clickOdbc data source (32-bit), Click to enter and selectUser DSN (which is the default one), SelectMs access 97 DATABASE option, click 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service