Later discovered Find_in_set this magical function, for example: There is a Type field in the article table, he stores the article type, has 1 headlines, 2 recommendations, 3 hotspots, 4 text ... 11,12,13, etc.Now he has an article that is both a
1, use case to redefine the numeric type SELECT Id,title,(case date, ' 0000-00-00 ' THEN ' ELSE date end) As DateFrom your_tableSELECT Id,title,(Case status when 0 THEN ' open ' if 1 THEN ' close ' ELSE ' standby ') As StatusFrom your_table 2, find
There is such a demand1: Class tableID class_name2: Student TableID Name class_idIf we were to check all the classes and the students in each class, you would have thought of that:
The code is as follows
Copy Code
The common Backup tool is the mysqldump with MySQL,
The code is as follows
Copy Code
Mysqldump-u root-p Password dbname >d:\test.sql------------back up a libraryMysqldump-u root-p Password dbname tablename>d:\test.sql----
The process of modifying the MySQL password is as follows
Baidu search an article to see the use of
Format: Mysqladmin-u username-P Old password password new password
I look at the operation when modified
Enter Password:
Welcome to the MySQL
has been using TORNDB and sqlalchemy, this time I pay attention to the next mysqldb, I feel that if you know more about T-SQL, or with mysqldb more flexible, and very simple, isn't it? All of its operations are done with one execute () method.
When using MySQL, there is usually a self increasing ID field in the table, but when we want to empty the data in the table to add data again, we want the ID to start counting back from 1, in the following two ways:
The usual way to set up a
Random Read data
The MySQL Self statement can be implemented, as illustrated below:For example, I want to randomly read 6 of data displayed to the viewer:MySQL statement:
The code is as follows
Copy Code
"SELECT * from
The code is as follows
Copy Code
jquery+php+mysql implement the function of input auto-completion hint jquery+php+mysql implement the function of input auto completion hint Input english keywords" jQuery "and Chinese keywords" use "
The root causes that affect database performance:
1, disk I/O read
2,CPU Utilization Rate
3, Resource competition
The way to optimize:
1, design optimization
2, Operation optimization
3, using other optimization techniques
1) Design
Using software:mysqlmigrationtool
Tip the data is too large to import. Modify the my.cnf file Max_allowed_packet = above 100M. In the Windows operating system, MY.CNF may not appear, need to use the editor to enter the address directly: Disk
Yesterday we talked about the MySQL tutorial stored procedure creation modification and deletion, this tutorial is about the definition assignment of variables in MySQL stored procedure Oh.
definition of a variable
Define a variable syntax as
MySQL tutorial is different from most database tutorials, there is a storage engine in MySQL, for different needs, users can choose the most suitable for their own storage engine, then there are many types of storage engine MySQL, and their
In the MySQL tutorial, stored procedures or functions cannot be deleted in bulk, only one stored procedure or function can be deleted at a time, and a stored procedure or function needs to have alter routine permission for that procedure or function.
SolvePHPAccess mySQL4.1garbledProblemMulti-language support introduced from MySQL 4.1 is really great, and some of the features already outweigh the otherDatabase Tutorialssystem。 But I found out during the test that PHP used before MySQL
The following is the file code for backing up a Mysql database through Apache PHP in Linux:File 1. Listtable. php (the file lists all tables in the database for backup)Select the table to back up:$ Con = mysql_connect ('localhost', 'root', 'xswlily '
During our website design and production process, it is more convenient to save images to the database than to save them as files. PHP and MySQL can easily implement the above functions. In this article, we will show you how to save images to the
Assume that there are host A and host B (Linux system). The IP address of host A is 1.2.3.4 (of course, it can also be dynamic), and the IP address of host B is 5.6.7.8. Both hosts are installed with PHP + Mysql. Now we are operating on the data on
Field type1. INT [(M)]Normal size integer type2. DOUBLE [(M, D)] [ZEROFILL]Normal size (double precision) floating point numeric type3. DATEDate type. The supported range is '2017-01-01 'to '2017-12-31 '. MySQL displays the DATE value in 'yyyy-MM-DD
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