MySQL裝有一個名為mysql的命令行,在提示符下輸入mysql將出現如下的簡單提示:
~ mysqlWelcome to the MySQL monitor. Commands end with ; or /g.Your MySQL connection id is 135Server version: 5.5.35-0ubuntu0.13.10.1 (Ubuntu)Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql>
mysql的命令行參數一般有:
-u 用戶名
-p 密碼
-h 主機名
-P 端口號
例如:mysql -u root -p -h localhost -P 3306
命令行會提示你輸入密碼
Enter password:
也可以直接輸入密碼,mysql -p123456 或者mysql --password=123456
進入mysql后,SHOW DATABASES顯示數據庫信息,USE DATABASE進入數據庫,SHOW TABLES顯示table信息。
要顯示某一table的列信息,SHOW COLUMNS FROM table或者DESCRIBE table。
其它的SHOW用法:
SHOW STATUS:顯示服務器信息
SHOW GRANTS:顯示用戶的權限
SHOW ERRORS,SHOW WARNINGS,顯示錯誤或警告信息。
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com