Recently, because of the need to study the MySQL random extraction implementation method. For example, to randomly extract a record from the TableName table, the general wording would be: SELECT * from TableName ORDER by RAND () LIMIT 1.
There are
Copy Code code as follows:
One
DECLARE @s varchar (20)
DECLARE @i varchar (20)
Set @i= '
Set @s= ' new member must purchase 350 Yuan product '
While PATINDEX ('%[0-9]% ', @s) >0
Begin
Set @i=@i+substring (@s,patindex ('%[0-9]%
Commands for backing up the MySQL database
Mysqldump-hhostname-uusername-ppassword databasename > Backupfile.sql
back up the MySQL database to back up the MySQL database in a format with a delete table in the format with
Problem:
When using Ajax to pass data to the server on Google Map, the server side is displayed as URL garbled,
The Zend Framework stores data to MySQL as garbled, but extracts it as a normal Chinese font,
MySQL input Chinese, displayed on the PHP
When using the mysqldump command backup,--all-databases can back up all the databases. You can also exclude established tables by using ignore-table. However, Mysqldump has no parameters to exclude the database.
When there are fewer databases to
Often encounter this situation, in an environment can not access the Internet through the MySQL client login database, want to perform an operation, but forgot the operation of the specific syntax, all kinds of inconvenient.
In fact, the MySQL
ERROR 2019 (HY000): Can ' t initialize character set gb2312engaged in a very half-day, MySQL has been reloading two times, the number of tragedies ...Before the system code was set, it was all UTF-8.
vi/etc/sysconfig/i18n
This article illustrates the solution to the problem of MySQL lock table. Share to everyone for your reference, specific as follows:
A lot of times! Just accidentally lock the watch! Here is the ultimate way to solve the lock table!
Case A
Today suddenly received an alarm message saying yes/disk space used over the threshold. After viewing, found that there are a lot of abnormal SQL, can not be executed, resulting in processing, resulting in a temporary consumption of/TMP disk space.
In a MySQL query, duplicate values may be included. This is not a problem, but sometimes you may want to list only the different values (distinct).
Keyword DISTINCT is used to return only a different value, that is, to go heavy. The usage is also
The example of this article analyzes the MySQL hint the InnoDB feature is disabled need to open the InnoDB solution. Share to everyone for your reference, specific as follows:
First, the question:
Create a data table error:
ERROR 1289:the '
This article describes the MySQL based on DOS command line login operation method. Share to everyone for your reference, specific as follows:
The common MySQL command-line login statements are as follows:
Copy Code code as follows:
Mysql-h
MySQL change data file storage path feel directly to the/etc/my.cnf in the DataDir to restart the service on the line, but search from the Internet more than n data, most of the changes in the My.cnf DataDir and sock and startup scripts/etc/rc.d/
First, download, here Use the green uncompressed version
Http://mirror.services.wisc.edu/mysql/Downloads/MySQL-5.1/mysql-noinstall-5.1.32-win32.zip
Second, the configuration of MySQL parameters
1, unzip the green version of the software to
MySQL started with the 4.1 version of the concept of character set, so for MySQL4.0 and the following version, their character set is Latin1, so sometimes need to do a bit of MySQL's character set for conversion, MySQL version of the upgrade,
To randomly extract a record from the TableName table, the general wording is: SELECT * from TableName ORDER by RAND () LIMIT 1.
But then I looked up the official MySQL manual, and the hint for rand () probably meant that the rand () function could
For large databases, it is very quick to load the data into a table with no Fulltext index and then use ALTER table (or CREATE index) to create the index. It will be very slow to load data into a table that already has a fulltext index.
1.
The example in this article describes the method of thinkphp3.x connecting to the MySQL database. Share to everyone for your reference, specific as follows:
Formula Profile: thinkphp/conf/convention.php
(1) Fill in the configuration file in the
PUREFTP integrated MySQL authentication is to save the FTP user information to the MySQL database, so that a large number of FTP server to do centralized management, user account maintenance as long as through the operation of MySQL can be completed.
First of all, MySQL's character set problem. Windows can be modified by modifying the My.ini within the
Default-character-set=utf8 //client's default character set
Enter in the MySQL client tool
Shows the following
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