Show tables or show tables from database;
Explanation: displays the names of all tables in the current database.
Show databases;Explanation: displays the names of all databases in MySQL.
Show processlist;Explanation: displays all processes
Today I wrote a small
Program, Very small, but it is able to establish a link between PHP and MySQL and implement simple SQL statements.
This is the first test for beginners.
ProgramSource codeAs follows:CopyCodeThe Code is as follows: $ Conn =
I have summarized the common methods for determining whether a record exists:
SQL statement: Select count (*) from tablename;
Then read the value of Count (*) to determine whether the record exists. The performance of this method is a waste. We
Put mysql.exe in the binary directory under mysqldirectory under c: \ windows. You can run the following command:
Connection: mysql-H host address-u user name-P User Password (Note: U and root do not need to add spaces, the same is true for
In MySQL database operations, we often write some SQL statements to implement the functions we want. However, it seems difficult for beginners of MySQL databases. This article summarizes six useful SQL statements. Beginners can use the following
I can see the post on "http/rest client" on the blog of Zhang banquet. I will skip all the installation steps. Next I will go directly to the test stage: virtual machine.
Copy codeThe Code is as follows: [root @ localhost ~] # Uname-
Linux sunss 2.6.
I. MySQL: indexes are saved in B-tree format.
The Memory storage engine can select Hash or BTree indexes. Hash indexes can only be used for Equality comparison of = or .
1. Normal index: create index on Tablename (column list)
Alter table TableName
1: Enable binlog Logging
Modify the mysql configuration file mysql. ini and add it under the [mysqld] node.
Copy codeThe Code is as follows: # log-bin
Log-bin = E:/log/logbin. log
Do not include Chinese characters or spaces in the path. Restart the
Statement:
UPDATE test SET age = 5 WHERE 'name' = 'wang taobao'
As the name implies, Wang's age is changed to 5, but the result is helpless --
The number of affected rows is 0. What's going on? The syntax is correct. It's okay ......
I
Ultimately, the following solutions are provided:
1. Clear the installation directory of MYSQL. The default value is C: \ Program Files.
2. Clear the MYSQL Data storage directory, which is generally in the C: \ Documents and Settings \ All Users.
1. query the first row of records:
Select * from table limit 1
2. query records from row n to row m
Select * from table1 limit n-1, m-n;
SELECT * FROM table LIMIT 5, 10; returns records FROM 6th rows to 15th rows
Select * from employee limit 3,
In this case, you need to modify the user permissions in MySQL and grant the required permissions.
This article demonstrates this situation and provides detailed solutions.
The configuration in this example is as follows:
Discuz!Database Name:
For two-way database images, data changes of database A must be mirrored to database B, and modifications in database B must be copied to database A at the same time.
For cyclic database images, multiple databases A, B, C, and D must be mirrored to
Copy codeThe Code is as follows: DELIMITER $
USE 'servant _ 591up' $
Drop procedure if exists 'SP _ move_data '$
Create procedure 'SP _ move_data '()
BEGIN
DECLARE v_exit int default 0;
DECLARE v_spid BIGINT;
DECLARE v_id BIGINT;
DECLARE I INT
10 data records are also retrieved.
Select * from yanxue8_visit limit, 10 and
Select * from yanxue8_visit limit 0, 10
It is not an order of magnitude.
There are also many five limit optimization guidelines on the Internet, which are translated from
Function: FROM_UNIXTIMEPurpose: display the time stored in INT (11) in MYSQL in the "YYYY-MM-DD" format.Syntax:FROM_UNIXTIME (unix_timestamp, format)
Returns a string representing the Unix time mark, formatted according to the format string. Format
Problem: when the short message is reviewed, it will be determined based on the content. For example, if the content of a can pass, and the content of B cannot pass, MySQL displays msg = a, msg = B, however, if the content of the msg field contains
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.