2013年7月23日星期二

MySQL範例資料庫>的

Original post http://anothermysqldba.blogspot.com/2013/07/mysql-sample-databases.html

我看到一個帖子上forums.mysql.com網站有關樣本數據庫,我想它可能是值得後,他們為他人給予了簡要概述。

樣本數據庫可以在這裡找到: http://dev.mysql.com/doc/index-other.html
通過MySQL命令行,你就可以將這些數據庫:

$ tar -vxf sakila-db.tar.gz
$cd sakila-db
$ mysql -u root -p < sakila-schema.sql
Enter password:
$ mysql -u root -p < sakila-data.sql
Enter password:

$ gzip -d world_innodb.sql.gz
$ mysql -u root -p -e "DROP SCHEMA IF EXISTS world";
Enter password:
$ mysql -u root -p -e "CREATE SCHEMA world";
Enter password:
$ mysql -u root -p world < world_innodb.sql
Enter password:

你的想法。 sakila的示例數據庫有DROP SCHEMA和CREATE SCHEMA文件中的命令,所以沒有必要做這一步,該架構。

您也可以使用MySQL Workbench來加載這些數據。
  • 你的數據庫創建一個連接句柄。
  • 使用這個新創建的連接句柄來建立一個服務器管理實例。
  • 雙擊您的新實例。
  • 在“數據導出/恢復,你應該看到一個數據導入。
  • 從一個自足的文件導入
    • 文件路徑將會sakila的data.sql的位置sakila的schema.sql的再重複
    • 您可以選擇一種模式,或在世界的情況下,創建一個新的。
    • 選擇“開始導入”,然後你會導入進度視圖。
您現在訪問你的數據庫的示例數據庫。

$ mysql -u root -p
>使用sakila的
>顯示表;
>選擇*從演員上限3;
+ ---------- + ------------ + ----------- + ------------- -------- +
| actor_id | FIRST_NAME |姓氏| LAST_UPDATE |
+ ---------- + ------------ + ----------- + ------------- -------- +
| 1 |佩內洛普| GUINESS | 2006-02-15 4點34分33秒|
| 2 |尼克| WAHLBERG | 2006-02-15 4點34分33秒|
| 3 | ED |的CHASE | 2006-02-15 4時34分33秒|
+ ---------- + ------------ + ----------- + ------------- -------- +
通過工作台:
  • 關閉“管理”選項卡
  • 選擇您的連接手柄下的SQL開發
  • 您可以只需鍵入SELECT * FROM演員上限3打閃電。
  • 或者你可以鍵入的命令部分和表名或列名上雙擊填充你的名字。 然後選擇燈光螺栓。
現在,你有數據開始玩和學習。

如果你想將表添加到這個,你可以使用MySQL命令行或SQL開發並右鍵單擊您選擇的架構下的“表”和“創建新的表”

2013年7月17日星期三

在MySQL中的狀態變量。

Original post: http://anothermysqldba.blogspot.com/2013/07/check-in-on-your-status-variables-in.html

所以,你有你的數據庫運行不如預期。 
但果真如此嗎? 難道是操作好? 

當是你最後一次檢查一些狀態變量? 

一些關鍵監控狀態變量: 

所以把它簡單地.... 檢查你的狀態!

2013年7月16日星期二

MySQL分發調查

我創造了這個普通的MySQL分發調查。結果將在調查結束。所有的問題都需要(只有4個問題)我曾試圖針對每個調查,這個博客的語言英寸

結果都不會任何MySQL的分佈,但在這裡,供市民瀏覽

請在這裡參加調查:
http://www.surveymonkey.com/s/KMW9V9V

2013年7月13日星期六

從MySQL直接導出CSV

Original post: http://anothermysqldba.blogspot.com/2013/07/export-csv-directly-from-mysql.html

首先這是另一篇博客在這裡:
但是,因為我看到這個上forums.mysql.com發布,我想我會給長一點的例子。

因此,在這個例子中我使用的是世界數據庫。 它是可供免費下載,在這裡:

mysql>desc City;
+-------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+----------+------+-----+---------+----------------+
| ID | int(11) | NO | PRI | NULL | auto_increment |
| Name | char(35) | NO | | | |
| CountryCode | char(3) | NO | MUL | | |
| District | char(20) | NO | | | |
| Population | int(11) | NO | | 0 | |
+-------------+----------+------+-----+---------+----------------+




mysql> SELECT ID, Name, CountryCode , District , Population
INTO OUTFILE '/tmp/City_data.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM City ;
Query OK, 4079 rows affected (0.04 sec)




# more /tmp/City_data.csv
1,"Kabul","AFG","Kabol",1780000
2,"Qandahar","AFG","Qandahar",237500
3,"Herat","AFG","Herat",186800
4,"Mazar-e-Sharif","AFG","Balkh",127800
5,"Amsterdam","NLD","Noord-Holland",731200
6,"Rotterdam","NLD","Zuid-Holland",593321
7,"Haag","NLD","Zuid-Holland",440900
8,"Utrecht","NLD","Utrecht",234323
9,"Eindhoven","NLD","Noord-Brabant",201843


2013年7月4日星期四

UPDATE OPTIONS與LIKE一起REGEXP,SUBSTRING,和LOCATE

Original post: http://anothermysqldba.blogspot.com/2013/07/update-options-with-like-regexp.html

最近的一項的論壇的職位做了我停止,並覺得對於了片刻..
http://forums.mysql.com/read.php?10,589573,589573#MSG-589573

該的問題是,的用戶通緝,以更新只是的字的出租audi和而不是這個詞核數師。
它已於通過輕鬆地服用的本期間內的優勢,,一旦我停了下來試圖,以使用的,SUBSTRING和LOCATE解決。 ,他們想要一個快速和容易的的修正程式在的所有之後。


root@localhost [test]> CREATE TABLE `forumpost` (
-> `name` varchar(255) DEFAULT NULL
-> ) ENGINE=InnoDB;

root@localhost [test]> insert into forumpost value ('An auditor drives an audi.'),('An auditor drives a volvo.');

root@localhost [test]> select * from forumpost;
+----------------------------+
| name |
+----------------------------+
| An auditor drives an audi. |
| An auditor drives a volvo. |
+----------------------------+ 


所以現在就讓我們來更新它的快速和容易的的的的方式通過服用的本期間內的優勢,

root@localhost [test]>UPDATE forumpost SET name = REPLACE(name, 'audi.', 'toyota.') WHERE name LIKE '%audi.';
Query OK, 1 row affected (0.20 sec)
Rows matched: 1 Changed: 1 Warnings: 0

root@localhost [test]> select * from forumpost;
+------------------------------+
| name |
+------------------------------+
| An auditor drives an toyota. |
| An auditor drives a volvo. |
+------------------------------+ 


但是...... 什麼關於的有效的選項的SUBSTRING的和LOCATE .....


root@localhost [test]> insert into forumpost value ('An auditor drives an audi.');
root@localhost [test]> insert into forumpost value ('An auditor drives an audi car');
root@localhost [test]> select * from forumpost;
+-------------------------------+
| name |
+-------------------------------+
| An auditor drives an toyota. |
| An auditor drives a volvo. |
| An auditor drives an audi. |
| An auditor drives an audi car |
+-------------------------------+ 


首先測試您的的的,所以你使請務必你可以找到後,你是什麼東西的選項..


root@localhost [test]> SELECT * FROM forumpost WHERE name REGEXP 'audi car$';
+-------------------------------+
| name |
+-------------------------------+
| An auditor drives an audi car |
+-------------------------------+ 

root@localhost [test]> SELECT * FROM forumpost WHERE name LIKE '%audi car%';
+-------------------------------+
| name |
+-------------------------------+
| An auditor drives an audi car |
+-------------------------------+


那真的沒有做太多,自我們只是改變了本期間為的字車以來,。 因此,保持回事....

,我們需要,以拉只是這個詞的出租audi從該行與出租audi汽車。

root@localhost [test]> SELECT SUBSTRING(name,-8,4), name FROM forumpost WHERE SUBSTRING(name,-8,4) = 'audi';
+----------------------+-------------------------------+
| SUBSTRING(name,-8,4) | name |
+----------------------+-------------------------------+
| audi | An auditor drives an audi car |
+----------------------+-------------------------------+ 


的子串允許我到上拉的第一個的4個字符,後,我數了數回8個字符從的一端。

那麼,什麼如果你不知道的位置的字符,呢?
與你是否要啟動,應該檢討你的數據,以確保你知道你是什麼後,的。 但是,這些字符可能是圍繞您的的的字符串移動,所以讓我們與LOCATE的工作。

,我會添加另一行只是為的測試。

root@localhost [test]> insert into forumpost value ('An auditor drives an red audi car');
Query OK, 1 row affected (0.04 sec)

root@localhost [test]> select * from forumpost;
+------------------------------------+
| name |
+------------------------------------+
| An auditor drives an toyota. |
| An auditor drives a volvo. |
| An auditor drives an audi. |
| An auditor drives an audi car |
| An auditor drives an audi blue car |
| An auditor drives an red audi car |
+------------------------------------+ 


所以,不管,的的結局中,我們可以看到那個出租audi總是後,核數師,,所以我們只是需要跳過過度那個詞。 “核數師”這個詞是在第一的8個字符的,所以跳過的那些。

root@localhost [test]> SELECT LOCATE('audi', name,8), name FROM forumpost WHERE LOCATE('audi', name,8) > 0 ;
+------------------------+------------------------------------+
| LOCATE('audi', name,8) | name |
+------------------------+------------------------------------+
| 22 | An auditor drives an audi. |
| 22 | An auditor drives an audi car |
| 22 | An auditor drives an audi blue car |
| 26 | An auditor drives an red audi car |
+------------------------+------------------------------------+ 


OK(確定),所以,我們發現了的那些我們所後,的。 現在,,我們需要,,以寫的update語句。

,我們不能使用的replace此的時間。

UPDATE forumpost SET name = REPLACE(name, LOCATE('audi', name,8), 'mercedes') WHERE LOCATE('audi', name,8) > 0 ;
Query OK, 0 rows affected (0.02 sec)
Rows matched: 4 Changed: 0 Warnings: 0 

請注意它發現了的行,但沒有改變任何東西。

所以,再試一次,並我不希望,以承擔的位置8。 我想出租audi的第二個值的。
因此,一個測試顯示了,與SUBSTRING_INDEX,我可以跳過一日一,並用USE CONCAT

SELECT name , CONCAT ( SUBSTRING_INDEX(name, 'audi', 2) , ' mercedes ' , SUBSTRING_INDEX(name, 'audi', -1) ) as newvalue
FROM forumpost
WHERE LOCATE('audi', name,10) > 0 ;
+-----------------------------------+-----------------------------------------+
| name | newvalue |
+-----------------------------------+-----------------------------------------+
| An auditor drives an audi. | An auditor drives an mercedes . |
| An auditor drives an audi. | An auditor drives an mercedes . |
| An auditor drives an audi car | An auditor drives an mercedes car |
| An auditor drives an red audi car | An auditor drives an red mercedes car |
+-----------------------------------+-----------------------------------------+

root@localhost [test]> UPDATE forumpost SET name = CONCAT(SUBSTRING_INDEX(name, 'audi', 2) , ' mercedes ' , SUBSTRING_INDEX(name, 'audi', -1) )
WHERE LOCATE('audi', name,10) > 0 ;
Query OK, 4 rows affected (0.03 sec)
Rows matched: 4 Changed: 4 Warnings: 0

root@localhost [test]> select * from forumpost;
+-----------------------------------------+
| name |
+-----------------------------------------+
| An auditor drives an mercedes . |
| An auditor drives a volvo. |
| An auditor drives an mercedes . |
| An auditor drives an mercedes car |
| An auditor drives an red mercedes car |
+-----------------------------------------+
5 rows in set (0.00 sec) 


現在,授出一本語法,配合使用的“一個”是無效的的,但那是另一個故事。

上的這些可以的的更多信息,被在這裡找到:

2013年7月3日星期三

了解你的MySQL服務器

Original post: http://anothermysqldba.blogspot.com/2013/07/understand-your-mysql-server.html

我想通它寫出來的一些指引,以幫助大家了解自己的MySQL服務器的不同方面,可能會有所幫助。

這個數據已經收集到隨著時間的推移,我會盡我所能,參考文章。 總體考​​慮在這裡列出你最好的信息來源:
所以,為了這個例子,讓我們假設你剛剛接手負責一個MySQL服務器。 什麼是最好的方式來收集有效的信息需要知道...

你知不知道到數據庫的密碼? 如果它不使用mysql_config_editor(前5.6)你可以做一個小挖找出來。 否則,你必須重新啟動它,並迫使自己的方式。我們假設你不想重新啟動它。 如果你必須弄清楚如何使用-跳過發放表檢討以前的一些博客文章的例子: http://anothermysqldba.blogspot.com/search/label/--skip-grant-tables

因此,首先一些放在尋找密碼。 這也意味著,如果你做這些人以後可以找到密碼。
  • 找出是否有人在命令行上使用的密碼。
    • 歷史| grep的mysql的
  • 的的crontab-l
    • 如果你看到備份腳本或等這些腳本輸入密碼
  • my.cnf中定位。
  • bash_history的貓| grep的mysql的
  • 嘗試的mysql沒有密碼的,但當然希望是你的盒子是安全的。
  • 隨著MySQL 5.6的檢查,如果你已經有一個配置的帳戶
    • mysql_config_editor打印 - 所有
OK,所以你的帳戶信息,你是在包裝盒上。
跳轉到MySQL服務器之前先知道一點關於你的服務器。
這些信息有些你可能只知道,但為了安全起見。
例如在Linux系統上運行以下操作系統,發行版,內存,磁盤信息。
  • 貓的/ etc / *釋放
  • uname-a的
  • DF-啊
  • 安裝
  • 自由米
  • 頂部
  • 超過這個職位的Swappiness資訊http://www.mysqlplus.net/tag/swappiness/
  • 你有一個特定的cnf的文件正在使用?
    • 用ps-ef | grep的MYSQL | grep的CNF
    • DATADIR:
      • 用ps-ef | grep的MYSQL | grep的DATADIR

所以,現在跳轉到MySQL服務器,並開始收集一些數據。 my.cnf文件審查雖然可以給你的大部分信息,你還可以收集從服務器。

show variables like '%log%';


看在你的錯誤(ERR)文件審查任何問題。 這應該是一個地方,你看一個錯誤後啟動等

因此,如何在服務器上運行? 為了迅速收集以下運行狀態的命令。
  • 版本
  • 主題
  • 問題
  • 慢速查詢
  • 打開
  • FLUSH TABLES
  • 打開表
  • 平均每秒查詢

mysql> status


“mysqladmin的擴展狀態”命令,也可以給你的信息,但在服務器內使用grep也是有效的。

密切留意以下信息。
這也被張貼在這裡http://www.techrepublic.com/blog/opensource/10-mysql-variables-that-you-should-monitor/56

您可以查看帖子中提到,看到一個漂亮的表,解釋了一些這些值。 這些都是我想你應該留意雖然。

> show status like 'Handler_read_first';
> show status like 'Key_reads';
> show status like 'Select_full_join';


找出您的查詢運行速度慢的百分比整體。 希望這是一個小數目。
使用狀態信息來填充這些變量進行快速檢查。

set @slow_queries=<value in the status output>;
set @questions=<value in the status output>;
SELECT ROUND(100* (@slow_queries / @questions),2) "Slow Query percentage" \G


學習了解的輸出:SHOW ENGINE INNODB STATUS \ G
盯緊死鎖信息,這樣你就可以開始調試那些。

您的系統是否有觸發器,事件的存儲過程?

mysql> SELECT db, name FROM mysql.proc;
mysql> SELECT TRIGGER_SCHEMA , TRIGGER_NAME FROM information_schema.TRIGGERS ;
mysql> SELECT EVENT_NAME FROM information_schema.EVENTS ;


知道你的服務器變量

show variables like '%innodb%';
show variables like '%thread%';
show variables like '%table%';
show variables like '%buffer%';
show variables like '%cache%';


檢查您的用戶帳戶。
它們都具有有效的密碼。

SELECT Host, User ,
CASE
WHEN CHARACTER_LENGTH(Password) = 16 THEN 'Pre-4.1 I should update this'
WHEN CHARACTER_LENGTH(Password) > 16 THEN 'Valid password'
WHEN CHARACTER_LENGTH(Password) =0 THEN ' BLANK PASSWORD so I just do not care if people steal my stuff'
END as Password
FROM mysql.user;


了解你的InnoDB日誌文件,並想出一個良好的緩衝池大小。
男爵張貼在這裡: http://www.mysqlperformanceblog.com/2008/11/21/how-to-calculate-a-good-innodb-log-file-size/
閱讀他的文章,以了解更多有關。 下面是一個例子,如何使用此信息。 我用他的號碼的例子幫助。 像男爵說,運行在交通繁忙時得到有效的信息。

mysql>pager grep sequence; show engine innodb status\G select sleep(60); show engine innodb status\G pager;
mysql>SET @sequence1= 3836410803;
mysql>SET @sequence2= 3838334638;
mysql>select ( ( (@sequence2 - @sequence1) / 1024 / 1024 )* 60 ) /2 as innodb_log_file_size_used ;
mysql>select (@@innodb_log_file_size / 1024) / 1024 as current_log_file_MB_size;


緩衝池大小。
雖然下面的查詢周圍網發布,並給出一個有效的緩衝池起點,我也看到了一些無效的或不切實際的數字,根據它的服務器上。 就個人而言,檢討的結果,下面的查詢。 高峰流量和金額數據發送到每男爵後的日誌審查結果。 然後考慮你有多少內存在服務器上。 你的數據庫在內存中運行的速度就越快,得到的結果,但你必須考慮到,什麼是數據庫做。 所以,你必須使用自己的緩衝池的大小,以獲得良好的價值判斷和研究。 另一個選項可以使用tools.percona.com,回答問題,並看看它會告訴你什麼。


mysql>select ( ( (@sequence2 - @sequence1) / 1024 / 1024 )* 60 ) *2 as innodb_buffer_pool_GB_test ;

mysql>SELECT CONCAT(ROUND(KBS/POWER(1024,
IF(PowerOf1024<0,0,IF(PowerOf1024>3,0,PowerOf1024)))+0.49999),
SUBSTR(' KMG',IF(PowerOf1024<0,0,
IF(PowerOf1024>3,0,PowerOf1024))+1,1)) recommended_innodb_buffer_pool_size
FROM (SELECT SUM(data_length+index_length) KBS FROM information_schema.tables
WHERE engine='InnoDB') A,
(SELECT 3 PowerOf1024) B \G



接下來,你應該檢討這個開放方舟博客文章挖成索引等。 該帖子和網站整體的大的信息。
http://code.openark.org/blog/mysql/useful-database-analysis-queries-with-information_schema


挖掘到更多有關服務器的數據....


什麼是最古老的表,也許需要存檔這些嗎?

SELECT CONCAT(`TABLE_SCHEMA`, "." , `TABLE_NAME`) as name , `UPDATE_TIME`
FROM information_schema.TABLES
WHERE TABLE_SCHEMA NOT IN ('information_schema','mysql','test','performance_schema') AND `UPDATE_TIME` IS NOT NULL ORDER BY `UPDATE_TIME` LIMIT 25;



什麼是空間?

SELECT concat(table_schema,'.',table_name) table_name,
concat(round(data_length/(1024*1024),2),'M') data_length
FROM information_schema.TABLES
ORDER BY data_length DESC LIMIT 5;


這僅僅是一個起點,讓你了解正在發生的事情與您的服務器。 使用本網站列出的網站了解更多信息。

2013年7月1日星期一

MySQL 5.6的Solaris上使用Solaris PKG

Original post: http://anothermysqldba.blogspot.com/2013/06/mysql-56-on-solaris-using-solaris-pkg.html

在在MySQL.com網站上安裝MySQL在Solaris上的文檔做得很好。 超鏈接可以在下面找到。

我創建作為參考,例如它是如何做的,以及這個職位。
(我喜歡在bash shell,但是這僅僅是我...)

bash-3.2# groupadd mysql
bash-3.2# useradd -g mysql mysql
bash-3.2# pkgadd -d mysql-5.6.12-solaris*.pkg

The following packages are available:
1 mysql MySQL Community Server (GPL)
5.6.12

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: all


現在你可以休息一下。 的Solaris OT過程需要一點點,並安裝在這裡。


Processing package instance <mysql> from </export/home/mysql-5.6.12-solaris10*.pkg>

MySQL Community Server (GPL) 5.6.12
Copyright (c) 2000, , Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
Using </opt/mysql> as the package base directory.
## Processing package information.
## Processing system information.
1 package pathname is already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

The selected base directory </opt/mysql> must exist before
installation is attempted.

Do you want this directory created now [y,n,?,q] y
Using </opt/mysql> as the package base directory.
## Processing package information.
## Processing system information.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <mysql> [y,n,?] y


Installing MySQL Community Server (GPL) as <mysql>
.....


再次讓它做一些工作......


......2013-06-30 17:40:12 1117 [Note] InnoDB: Starting shutdown...
2013-06-30 17:40:12 1117 [Note] InnoDB: Shutdown completed; log sequence number 1625987

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/opt/mysql/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /opt/mysql/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /opt/mysql/mysql/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings


Installation of <mysql> was successful.


所以現在每dev.mysql.com instructins的

bash-3.2# ln /etc/init.d/mysql /etc/rc3.d/S91mysql
bash-3.2# ln /etc/init.d/mysql /etc/rc0.d/K02mysql


所以,現在如果我要使用的數據庫,我必須得到過去的root密碼,動態創建的第一。 我個人很喜歡這個功能。


# /etc/init.d/mysql start
Starting MySQL
........ SUCCESS!
bash-3.2# ls -al /.mysql_secret
-rw------- 1 root other 96 Jun 30 17:40 /.mysql_secret
# more /.mysql_secret
# The random password set for the root user at Sun Jun 30 17:40:07 2013 (local time): c29IHIZ4


所以,讓我們登錄並更改密碼,然後我們準備開始。 坦率地說,你有沒有其他的選擇。


bash-3.2# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.12

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> show grants for 'root'@'localhost';
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('somepassword');
Query OK, 0 rows affected (0.04 sec)


就是這樣。 我們現在好了,準備去...


mysql> exit
Bye
bash-3.2# rm -f /.mysql_secret
bash-3.2# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.12 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 5.6.12 |
+-----------+
1 row in set (0.00 sec)


引用| |有用的鏈接: