mysql 常用到的命令

2021-08-28 05:36:32 字數 1142 閱讀 7349

環境:

windows10系統、mysql5.7版本

在 dos 環境下:

1、啟動 mysql 服務:net start mysql57

2、停止 mysql 服務:net stop mysql57

3、進入 mysql 資料庫:mysql -hlocalhost -uroot -p

注意:其中-h表示伺服器名,localhost表示本地;-u為資料庫使用者名稱,root是mysql預設使用者名稱;-p為密碼,如果設定了密碼, 可直接在-p後鏈結輸入,如:-p123456,使用者沒有設定密碼,顯示enter password時,直接回車即可。如果你的 mysql 沒有安裝在c 盤下你需要先使用 dos 命令進入 mysql 的安裝目錄下的 bin 目錄中。)

在 mysql 資料庫中:

1、顯示資料庫:show databases;

2、退出資料庫:exit;

3、建立乙個名稱為 「xiaoguai」 資料庫:create database xiaoguai;

4、建立乙個資料庫表:create table guai(title char(20),keywd char(30))

5、使用該資料庫「xiaoguai」:use xiaoguai

6、顯示資料庫中所有的表:show tables

7、查詢資料庫表的內容:select * from guai;

8、向資料庫表插入資料:insert into guai(title,keywd)  values('title1','keywd1')

mysql系統命令 常用到的mysql系統命令

本文主要給大家介紹常用到的mysql系統命令,文章內容都是筆者用心摘選和編輯的,具有一定的針對性,對大家的參考意義還是比較大的,下面跟筆者一起了解下常用到的mysql系統命令吧。desc 表名 表資訊 show columns from 表名 表字段 describe 表名 表資訊 show cre...

Linux常用到的命令

記錄一下日常用到的linux命令,就當做日誌了 1 檢視linux 埠號 netstat apn grep 80 2 殺死程序 kill s 9 pid tomcat 啟動不起來有可能是遠端除錯埠未關閉 或者tomcat埠未關閉 3 改變檔案的許可權 chmod 755 檔名 4 解壓 tar xz...

常用到的nuGet命令

a.初始化 migration enable migrations contexttypename mvcproject.models.projectdbcontext b.修改models add migration migrationname c 更新資料庫 update database d....