Drop user deletes all of the user's information, and delete only clears the users table, and other information, such as the DB table, exists.
If you create a user with the least privilege after delete, then he reuses the previous permissions.
Grant
The master/slave mechanism based on LAN can usually meet the requirement of ' real time ' backup. If the delay is large, first identify the following factors:1. Network Latency2. Master Load3. Slave loadThe general practice is to use more than one
I've seen a lot of questions about Mysql.sock on the internet before, and I didn't pay attention to the meaning of this thing, until my MySQL also appeared the same problem. It's a tangled one ...
Copy Code code as follows:
The INFORMATION_SCHEMA database was created after version 5.0 of MySQL, a virtual database that does not physically exist.
The INFORMATION_SCHEMA database is similar to the "Data Dictionary", which provides access to database metadata in the form of
Problem:
When I look at the code of a previous developer, I see
WHERE p.name NULL
What does the symbol mean in this query? Is it the same as the = number? Or is it a grammatical error? However, no errors or exceptions are displayed.
Recently and Sobin are doing a project for a boutique course, because a fixed ID is used as an association between tables, so after inserting data into the previous table, you pass the ID of the inserted data generation to the next table. Studied a
Small projects sometimes need to use keyword search relevance sort, with Sphinx appear overkill, with the order of MySQL by against.Method One:
Copy Code code as follows:
SELECT * from articles where (title-like '%keywords% ') or
In the MySQL manual has a bit of max_user_connections, it is used to restrict user resources, how to restrict user resources? Here's a little test.
The value of the global variable is first producedMysql> SELECT @ @max_user_connections;
+-----------
Temporary tables are present when the connection is not disconnected, once disconnected, the data and structure of the temporary table are in memory, you can do a quiz, you create a temporary table, but in the response data directory will not find.
When migrating to MySQL databases, it is sometimes necessary to migrate users and permissions within the source database. For this migration we can get the user's relevant permissions from the Mysql.user table to generate the corresponding SQL
After loading the database to clean up some default account, accidentally deleted root, flush privileges after the new root forgot grant any permissions, see mysqld options inside a −−skip-grant-tables
Copy Code code as follows:
The implementation of fuzzy query in MySQL has like and regexp.
------------------------
The use of like is known to many people, and the most common case is select * from a where name like '%a% ';
Where '% ' represents any character, its effect
Because work requires, write a custom number of MySQL lines, as follows
DELIMITER $$
DROP FUNCTION IF EXISTS ' onlinefunction ' $$
CREATE FUNCTION ' onlinefunction ' (rrrr VARCHAR (50)) RETURNS VARCHAR (255)
BEGIN
IF (rrrr= ' online ') THEN
Network environment:Host: Win7VirtualBox 4.1.4 + Ubuntu 11.10 Server 64bitHost use network cable, the client in bridged adapter mode, the use of Atheros AR8131 pci-e Gigabit Ethernet The Internet is no problem.When the host uses wireless, the client
Explain shows how MySQL uses indexes to process SELECT statements and join tables. can help you choose better indexes and write more optimized query statements.Using the method, add explain to the SELECT statement before you can:
Such as:
1. Select statements can be separated by carriage returns
$sql = "SELECT * from article where id=1"
and
$sql = "SELECT * from article
where id=1" can get the correct results, but sometimes it may be clearer to write separately , especially
After installing Mysql-python, the Import loading module prompts the following error.
Copy Code code as follows:
Importerror:libmysqlclient_r.so.16:cannot open Shared object file:no such file or directory
So Google's,
This article summarizes the MySQL export all index and constraints of the method, provided to everyone to facilitate the query use. Specifically as follows:
1. Export Create a self-added field statement:
SELECT
CONCAT (
' ALTER TABLE
A random query of a data
Method One: SELECT * from ' table ' ORDER by RAND () Limit 1
Evaluation: Not recommended, very inefficient, as stated in the official documentation: the Order BY and Rand () are used to scan the table multiple times,
Project development, in doing MyBatis dynamic query, encountered a problem:MySQL in the like fuzzy query, input English can be normal to retrieve the results, but the input of Chinese after the search results are empty.
Because the request is
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