1. Direct Reset Automatic increment value
The ALTER table syntax provides a way to reset AutoIncrement columns. Take a look at the example below.
ALTER TABLE table_name auto_increment = 1;
Note that you cannot reset the counter's value less than
When MySQL is sorted, if it needs to be sorted in the original order, you can use the ordering by Find_in_set () method, as follows:
The code is as follows
Copy Code
SELECT * from Ecs_goods where goods_id into ($idList)
A, what view View is an interface for storing data, or it can be said to be a virtual table. This data can be from one or several basic tables (or views) of data. It can also be data that the user has defined from. In fact, the view does not
PHP's MySQL creation database and table
The database has one or more tables.Creating a DatabaseThe Create DB statement is used to build a database in MySQL.Grammar
CREATE DATABASE database_name
To learn more about SQL, please
Connect to MySQL Database
Create a connection to the MySQL databaseWhen you can access the data in the database, you must create a connection to the database.In PHP, this is the point with the mysql_connect () function.Grammar
Mysql_connect
In MySQL's MyISAM engine, there is one that is easy to overlook, called Compressed index Pack_keys,
MyISAM uses prefix compression to reduce index size by compressing strings by default, or compressing integers
You can use Pack_keys to control the
In reality, MySQL can build a composite index based on business needs, because MySQL uses the B-tree format index, you can locate records directly without scanning. MySQL establishes the principle of the leftmost prefix for multiple-column indexes,
1. FOREIGN KEY constraints
A non-primary key field in a table, and if it is a primary key in another table, then this field is called a foreign key.
For example, there are now two tables:
Student Form-school number, name, sex, class number
Class
1. Description of federated Storage EngineFederated storage Engine enables remote Access database without replication or cluster technologyWhen creating a table based on the Federated storage Engine, the server creates only one table definition file
Paris Country 10m-100m Unlimited flow free universal space
Site size: 10m-100m (gradually increase the space to 1G) support the external chain
Background operation: The simplest Control Panel
Support scripts: ASP PHP5 HTM HTML CGI
There is no
View MySQL Maximum connection data
The code is as follows
Copy Code
Show variables like '%max_connections% '
To modify the method:
Into the MySQL terminal,
The code is as follows
Copy Code
Sometimes when we manage the database we need to use the command to perform import and export operations, because this is stable and reliable, not easy to have garbled appearance. and the imported database size is unrestricted.
MySQL Database
Using MYSQL for database backup is also a regular database backup method. It has the same concept as other database servers, but have you ever thought about it, mySQL will have a simpler backup method using the file directory, and it will be faster
Data verificationClear spacesThe trim function will clear spaces at the beginning and end of the data. Its syntax is:Trim ($ first_name );Processing of required fieldsSome fields must be entered in your database. In this way, the fields
Free FTP, PHP, MYSQL, no ads + Rice space bindingFree website hosting package Free1k.com includes:-1 000 m B storage space-enough or even the largest content website-000 MB bandwidth-the most abundant enterprise and personal websites. If you need
* 4000 MB disk space (4 GB storage)* 8000 MB transfer (8 GB bandwidth)* PHP/MySQL database* NO advertisement!* Free subdomains (http://username.4000webs.com )!* FTP or browser-based file manager* Fast innovation and reliable dual-core servers with a
SQL statementSELECT *FROM (SELECT 'field', count (*) AS totalFROM 'table name'Group by 'Group field') AS tWHERE total> 10 and grouping fields <> ""This means that after the joint query, the data found by the group is processed as a condition. After
Note:An online MySQL database server suddenly loses power, causing system failure to start up. After you reinstall the system, find the previous MySQL database folder.Problem:By copying files to restore the previous MySQL database, we found that 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