# Common basic operations for Structured Query Language in MySQL:/* DDL (Data Definition Language) Data Definition Language */# Create a database:Create database 'database name' charset utf8;# Delete a database:Drop database 'database name ';#
REPLACE runs like INSERT. There is only one exception. If an old record in the table has the same value as a new record used for the primary key or a UNIQUE index, the old record is deleted before the new record is inserted.
The values of all
Select can take alias, delete cannot.
1. When you use mysql to perform the delete from operation, if the FROM Statement of the subquery and the update/delete object use the same table, an error will occur.
Mysql> delete from tab1 WHERE col1 =
Check whether logs are enabledMysql> show variables like 'Log _ bin ';
How to know the current log
Mysql> show master status;
Display the number of binary logs
Mysql> show master logs;
Use mysqlbinlog to view binary log filesShell> mysqlbinlog
Batch text files are often used to back up or restore databases and saved as SQL text files. The methods for restoring data on Windows and Linux platforms are as follows:
1: Window, cmd command execution, enter the MySql installation directory such
You can CREATE an INDEX in the create table statement, or use the create index or alter table statement to add an INDEX to the TABLE. You can use alter table or drop index statements to delete indexes.(1) Use the alter table statement to create an
The MySQL plug-in storage engine is a component of the MySQL database server. It performs actual data I/O operations on the database and allows and enforces a set of specific features for special application requirements. One of the main advantages
To start the mysqld server from the command line, you should start the console window (or "DOS window") and enter the command:
C:> C: Program FilesMySQLMySQL Server 5.0 binmysqld
The path used in the preceding example varies depending on the MySQL
Mysql queries all information on the current day:
The Code is as follows:
Select * from test where year (regdate) = year (now () and month (regdate) = month (now () and day (regdate) = day (now ())
This is complicated and easy to write:
The Code is
Q: How can I solve the problem of MySQL 5.0.16 garbled characters?
A: The following method can be used to solve the garbled MySQL 5.0.16 problem:
1. Set phpMyAdmin
Language: Chinese simplified (zh-utf-8)
MySQL Character Set: UTF-8 Unicode (utf8
The following script uses the namp scanning tool. Therefore, if the nmap scanning tool is not installed in the system, you must first install the tool.
Script functions:
First, check whether the mysql port exists normally. If the port does not
The first step is to limit the concurrent processing of Innodb. If innodb_thread_concurrency = 0, you can change it to 16 or 64 to view the machine pressure. If
Very large. First change to 16 to put pressure on the machine, and then gradually
Table 'content _ tags' is marked as crashed and shoshould be retried red
Such errors
Problem Analysis:This prompt indicates that the '% s' table is corrupted and may be caused by an abnormal shutdown. you need to fix it.Solution:Repair table '
In general, we use mysqldump to back up the MySQL database and upload it to other backup machines. If the database is large, it may be slow during Backup transmission, so we try to make the backup file smaller.
When writing an automatic backup
I found some information, and then I used the two functions concat () and left () in MySQL string processing ()
1. [CONCAT (str1, str2 ,...)
Returns a string from the parameter link. If any parameter is NULL, return NULL. There can be more than
1. View MySQL database servers and database character sets
Show variables like '% char % ';
2. view the character sets supported by currently installed MySQL.
Show charset;
3. Set the encoding:
Modify my. cnf
Vi/etc/my. cnf
Add under
First, a local Mysql instance is installed, a navicat management tool is installed, and a new project is created for testing:A simple test method is to put a button, click it, read the remote image, save it to the database, and then read it and
Environment: CentOS 6.3 minimizes the default installation and configures the NIC.
Before installing MySQL, check that the Internet connection is normal to download the installation file.
Use the yum-y update command to upgrade the system to the
DELIMITER $$ USE `t_girl`$$ DROP FUNCTION IF EXISTS `func_range_string_mod`$$ CREATE DEFINER=`root`@`localhost` FUNCTION `func_range_string_mod`( f_num INT UNSIGNED -- Total strings. ) RETURNS VARCHAR(200) CHARSET latin1 BEGIN
1. To optimize the query, try to avoid full table scanning. First, consider creating an index on the columns involved in where and order.
2. Try to avoid using it in the where clause! = Or <> operator. Otherwise, the engine will discard the index
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