Mysqldump is a utility that MySQL uses to store databases. It primarily produces a SQL script that contains the command create TABLE inserts that are required to re-create the database from scratch. Now let us study together!
First, Mysqldump:
① Timestamp converted to date
Copy Code code as follows:
From_unixtime
For example:
The invest_time stored in the datasheet is a timestamp, such as 1429063399
Use From_unixtime to convert a timestamp to a date:
Copy
The memory table is a table in memory, the size of the memory used can be specified by the max_heap_table_size in my.cnf, such as max_heap_table_size=1024m, the memory table is not the same as the temporary table, the temporary table is stored in
Automatic deletion of temporary files 23:00 daily
First look at the crontab task list:Crontab-lAnd then NEW:Crontab-eAdd a line:* * * rm-rf/www/cmstest/my120/public/scripts/jpgraph/*Save exit.Restart Service:/etc/rc.d/init.d/crond restart
Second,
If you are not interested in long speeches, you can also see the results directly, perhaps you are interested in the results. In practical applications, storage, optimization can be done in more than 90 million of the query response speed control in
1. Create a stored procedure
Create a MySQL stored procedure Add_pro
Copy Code code as follows:
Delimiter//
drop procedure Add_pro//
CREATE PROCEDURE Add_pro (a int, b int, out sum int)
Begin
Set sum = a * b;
End
//
1. Query help? Contents2. Using the synthesized hash value, separating the blob or text3. Currency use fixed-point number (decimal or numberic)4.sql_mode?5.order by rand () limit 1000;6. Optimize Show status like ' Com ' com_select com_insert etc
MySQL defaults to a root user, but this user permission is too large, usually only in the management of the database to use. If you are connecting to a MySQL database in your project, it is recommended that you create a new user with a small
Introduction to the primary storage engine
1, InnoDB storage engine
InnoDB is the default transaction engine for MySQL, which is designed to handle a large number of short-term (short-lived) transactions. Unless there are very specific reasons to
Primary key
ALTER TABLE tablename Add new_field_id Int (5) UNSIGNED DEFAULT 0 not NULL anto_increment,add PRIMARY KEY (new_field_id);
Add a new column
Mysql>alter TABLE tablename ADD fieldname FieldType
Such as:
ALTER TABLE T2 ADD D
Background
Now I have such a need:
The user table for database a needs to be imported into the account table of database BUser table field: Uid,username,email,password,regdate,saltAccount table field: Id,name,email,password,type,saltThe imported
1, the first of course is to connect the database, the function prototype is as follows:
MySQL * stdcall mysql_real_connect (MySQL *mysql, const char *host,
const char *user,
const char *PASSWD,
cons T Char *db,
unsigned int port,
const char
Perhaps you will sometimes encounter the need to put the data of a table in the database according to the table of a field category output, such as a data table area as follows
We need to sort out the inside area according to the Serialize field,
Types of choices that contribute to efficiency
1, make your data as small as possible
One of the most basic optimizations is to make your data (and index) occupy as little space on disk (and in memory) as possible. This can be a huge improvement
The software version used in this article is as follows: PHP version 5.5.12;mysql version 5.6.17;apache 2.4.9 wampserverfirst, Phpmysql to achieve landingAltogether contains two documents:login.php and logincheck.php;Form code:
yonghu:
See a lot of users about MySQL login server problems, including some in PHP call MySQL occurs when the MySQL database server can not be logged into the problem, thought is php out of the question. In fact, the issue of MySQL permissions.
MySQL's
Overview
MySQL's Replication (replication) is an asynchronous replication process, copied from a MySQL instance (called Master) to another MySQL instance (we call it Slave). The implementation of the entire replication process between Master and
Using a database transaction ensures that all operations in addition to the transactional unit are completed successfully. The InnoDB engine's table in MySQL supports transaction. In a transaction, if a database operation fails, all operations
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