MySQL has a lot of basic commands, and the show command is also one of them. In many users, the use of the show command is also prone to confusion. This article summarizes the many usage of the show command.
A. show tables or show tables from
The MySQL stored procedure is a new feature added since MySQL 5.0.
The advantages of stored procedures are as follows. However, the most important thing is the execution efficiency and SQL code encapsulation.
In particular, the SQL code
I have a website that was previously created using asp.net. The database used is sqlserver, and I plan to use the PHP + MYSQL architecture. Because the original site has a certain ranking, a direct revision will lead to many error pages. It takes a
For example, in window7, right-click "computer"-click "properties"-click "Advanced System settings"-click "environment variables". The following figure is displayed:
"environment variables" in the lower right corner ".
select "PATH" and edit.
CONVERT () provides a way to CONVERT data between different character sets. Syntax:
CONVERT (expr USING transcoding_name)
In MySQL, the conversion code name is the same as the corresponding Character Set Name.
Example:
Select convert (_ latin1
In the "Create Database and database table with MySQL" article, how do we create a database and database table, and how to add records to the data database table. How can we retrieve data from database tables?
1. Retrieve Information from a
I have encountered the problem of "mysql server has gone away" during development. It is assumed that the wait_timeout setting on the MySQL server is exceeded due to the absence of operation for a long time, the connection is eventually reclaimed
How to query the differences between where and having:
Having clauses are similar but different from where clauses. They are all statements that set conditions.
In the Query Process, aggregate statements (sum, min, max, avg, count) are executed
During the past few days, data statistics are performed. During the statistical process of database data, You Need To group data by specified days,
If you haven't found a good method before, retrieve the data and group it in the program.
Run the df command to check whether the disk is full. Because the system default partition is used at that time, I don't know why I cannot resize it automatically! We will handle this issue later! :Copy codeThe Code is as follows: [root @ snsgou ~] #
The unified encoding method is UTF-8, And the csv file encoding method is set to UTF-8.
Create a new table in the database. The column attributes must be consistent with the csv file. Set ** month ** to date format in csv, instead of string, in this
Mysql converts the character encoding of a table to UTF-8.Copy codeThe Code is as follows:Alter table tb_anniversary convert to character set utf8;
Modify mysql character encoding to UTF8
Step 1: view the current character encoding methodCopy
I. Data Tables
To ensure data integrity and consistency, you must specify the field name, field type, and field attribute when creating a table. Constraints, indexes, and ), primary key and foregin key.
Constraints:
Not null non-empty
The slow log in mysql is a log tool used to record SQL statements that have been executed for a long time (beyond long_query_time seconds.
Enable slow log
Set in my. cnf
[mysqld]
slow_query_log=on
slow_query_log_file=mysql-slow
Restart
A Case Study of MySQL database techniques to prevent human misoperation
This question is from internal student training by old boys. It is a database security technique)
A few years ago, the old boy personally encountered a "Murder Case". The boss
The developer writes a view. It takes 30 minutes for the select statement to be optimized. The view is as follows:
It may take more than 30 minutes for a developer to select:
21068 rows in set (1987.08 sec)
First, parse the following:
Mysql>
MySQL has provided the optimizer Option Switch option since 5.1. In this way, we can force some things that we think should not be done when the optimizer is confused, or when we want to see why the optimizer is so selective, you can manually
The default Character Set of installed MySQL is latin1. To change the character set to what you need (such as utf8), you must change the related configuration file; in linux, the default installation directory of MySQL is distributed in different
Export SQL files
Use phpmyadmin to export the database as an SQL file at your original website service provider.
Upload SQL files
As mentioned above, we have not installed ftp on the cloud host. How can we upload it?
Open the ftp client software,
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