MySQL資料庫簡單操作

2021-09-24 17:36:04 字數 534 閱讀 7905

//建立資料庫,同時設定字符集和校驗規則

create

database

ifnot

exists testdb default

character

set utf8

collate utf8_general_ci;

//刪除資料庫,不存在會報錯

drop

database testdb;

//顯示所有資料庫

show

databases

;//改變資料庫的字符集

alter

database studentinfo character

set gbk;

//刪除已存在的資料庫

drop

database

ifexists studentinfo;

//顯示所有資料庫

show

databases

;//選擇資料庫

use jxgl;

Mysql資料庫簡單操作

net start mysql 服務名 l l net stop mysql 服務名停止 bin mysqladmin uroot shutdown l 登陸資料庫 開啟dos 視窗 l mysql u root p mysql lmysql uroot p p5188 db1 default ch...

MySQL資料庫簡單操作

1.c users administrator mysql u root p 客戶端連線資料庫伺服器 enter password 有密碼輸入密碼登入,沒有直接回車進入 2.mysql show databases 顯示資料庫 3.mysql drop database if exists clas...

簡單mysql資料庫操作

建立資料庫鏈結,mysql connect localhost mysql user mysql password or die could not connect mysql error 選擇資料庫 mysql select db mydb 設定字符集 mysql query set names ...