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)
[on DUPLICATE KEY update in the arena]
If the table is not insert, if so, update will need to use the MySQL on DUPLICATE KEY update syntax, so you can write less if statements in the code to judge the
The on DUPLICATE KEY update is specified
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
MySQL modify password, mysql modify root password, how to modify the MySQL password, mysql modify user password
The first thing to declare is that in most cases, MySQL is required to have root permissions in MySQL, so the general user cannot change
One, MySQL backup is nothing but the following several ways
1. mysqldump Tools
MySQL's own mysqldump is to convert data into SQL statements, which is inefficient, backup and restore slow, and any data inserts and updates are suspended in the dump
Now that most of the environment of MySQL running is on Linux, how to optimize the Linux operating system based on MySQL, we give some general simple strategy here. These methods help to improve MySQL performance.
Gossip less and get to the point.
The reading and writing separation and load balancing of MySQL database are usually realized by the third party software. It can also be implemented through the MySQL driver, such as Com.mysql.jdbc.ReplicationDriver.
Detailed documentation See also:
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
That's what Rand said in the handbook:
RAND ()RAND (N)
Cases
The code is as follows
Copy Code
SELECT * FROM table_name ORDER BY RAND () LIMIT 5;
Returns a random floating-point value in the range 0 through 1.0
10GB of DiskSpace100GB of bandwidthBasic PHP SupportOnline SupportFTP AccessSimple Control PanelNo ads *99% of normal running time
Description: If you want to bind your own domain name, then be sure to fill in when the application is clear.
The default maximum number of connections for MySQL 5.0 is 100, which may not be enough for a large load of concurrent requirements, at which point you can modify the maximum connection for MySQL.To view the current maximum number of connections for
Maybe a programmer to a del, a backup time set after the data to find can not find it back, check the data using MySQL log can be a good solution to the previous problem, the advantage: is to restore to a point in time, or an operation of SQL
Format: Grant permission on database. * To User name @ login host identified by "password"
For example, add a user user1 password for password1, so that it can be logged on the computer, and all databases have query, insert, modify, delete
All databases to one file:
The code is as follows
Copy Code
#!/bin/bashdate=$ (date + '%y%m%d ')to_dir= "/home/wyl/document/Daily/230_database"Date_dir=${to_dir} "/" ${date}Hostname= ' 192.168.1.230 'Username= ' Root
Add InnoDB to installed MySQL
1. First determine if there are ha_innodb_plugin.so and ha_innodb.so two files under MySQL ' Plugin_dir ', if not found, in your MySQL compilation directory with the following directory file ( Built in InnoDB and
The safest state is to operate on the console of the server and unplug the network cable.
1. To modify MySQL login settings:
# VI/ETC/MY.CNF
In the paragraph of [mysqld], add a sentence: Skip-grant-tablesFor example:
1. Semicolon exceptionsFor MySQL, the first thing you must remember is that every line of its command is ended with a semicolon (;), ...... There is no such thing as absolute. The same is true here. When a MySQL line is inserted in the PHP code, it
Free disk space and transport mg50 MB disk space1000 GB traffic per monthDomain name host 1Register now!Website Management tool mg freeCPanel control panel version 10.8.0FTP account 1Microsoft FrontPageWebalizer statisticsFree email mgPOP3/SMTP
Linux cleanup methodDelete the operation log of the database, as shown in the following figure:Mysql-bin.000001Mysql-bin.000002Mysql-bin.0000031. Enter mysql-u root-p and password2. Enter the reset master after successful entry ;!Mysql> reset master;
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