初學mysql命令

2022-03-27 05:32:50 字數 706 閱讀 8536

建立資料庫mydb:create database mydb;

刪除資料庫mydb:drop database mydb;

檢視資料庫列表:show databases;

檢視所有表的清單:show tables;

檢視資料庫mydb中所有表的清單:先選擇資料庫use mydb;再show tables;

檢視表table1的詳細資訊:describe table1;

新建乙個對資料庫裡所以的表如下許可權的資料庫使用者:grant selece,insert,delete,update onmydatebade.* to username identified by 'password';

一條語句中同時插入多條語句:insert into mytable(id ,keyword ) values('9','為什麼下雨'),('9','是'),('9','是是是');

刪除表中所有資料,主鍵從1重新開始:truncate table mytable;

刪除表中所有資料,主鍵繼續增長:delete from mytable;

Mysql 初學常見命令

如何使用已經安裝好的mysql資料庫管理系統?方法1 開始 所有程式,找到mysql程式資料夾下面的控制台命令提示框,在裡面輸入root使用者密碼,驗證成功之後,就可以使用了。方法2 在執行框中輸入cmd之後,開啟命令提示窗。切換到目錄 c program files mysql mysql ser...

MySQL初學 相關命令列記錄

查詢mysql狀態 service mysql status 開啟mysql服務 service mysql start 停止mysql服務 service mysql stop 登入mysql mysql u user p 其中user是登入使用者名稱 例如 root等 回車後會提示你輸入密碼 返...

初學DOS命令

作用 列出在指定的時間在計算機上執行已計畫或則計畫命令和程式。前提是 計畫 task scheduler 服務已啟動才能使用at命令。at ip id delete delete yes at computername time interactive every date next date co...