MySQL快捷命令


下表列出了各個提示符並簡述它們所表示的mysql的狀態:

提示符 含義
mysql> 准備好接受新命令。
-> 等待多行命令的下一行。
‘> 等待下一行,等待以單引號(“’”)開始的字符串的結束。
“> 等待下一行,等待以雙引號(“””)開始的字符串的結束。
`> 等待下一行,等待以反斜點(‘`’)開始的識別符的結束。
/*> 等待下一行,等待以/*開始的注釋的結束。

mysql help列表

?         (\?) Synonym for `help'.
clear     (\c) Clear the current input statement.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
ego       (\G) Send command to mysql server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to mysql server.
help      (\h) Display this help.
notee     (\t) Don't write into outfile.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
use       (\u) Use another database. Takes database name as argument.
charset   (\C) Switch to another charset. Might be needed for processing binlog
with multi-byte charsets.
warnings  (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.

mysql 命令

 

啟動命令
sudo service  mysql start 
關閉命令
sudo service mysql stop 
重啟命令
sudo service mysql restart 
查看狀態
sudo service mysql status
ps -aux | grep mysql
mysql 的登錄
mysql -uroot -p
mysql -uroot -pmysql (p后面是密碼)
退出
exit     /   quit   /   ctrl +d
查看版本
select version();
顯示當前時間
select now();

  




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM