使用命令列操作mysql

2022-08-12 06:03:12 字數 424 閱讀 1390

mysql -u root -p 輸入密碼後可通過命令列運算元據庫

show databases; 顯示資料庫

use test; 使用哪乙個資料庫

set charset gbk; 設定中文,避免中文亂碼

select * from jiba; 查詢資料表

insert into test.createdata values('10000','test_001','2020-11-02'); 插入資料

delete from createdata where name='test_001'; 刪除資料

update jiba set name='new value' where id='001' 更新資料

set global max_allowed_packet =419430400設定最大允許包 400m

mysql使用命令列工具 MySQL命令列工具

shell mysql user user name password your password db name shell mysql help shell mysql 選項 protocol mysql 命令 有些命令mysql可以自己解釋。要檢視這些命令,在mysql 提示下輸入help或 ...

mysql 命令列 回車 mysql命令列操作

顯示資料庫 show databases 當前資料庫 select database 顯示表show tables 更改表名稱 alter table 原表名 rename 新錶名 rename table 原表名 to 新錶名 檢視系統支援的引擎 show engines 檢視表的引擎 show ...

命令列操作mysql常用命令

啟動 net start mysql net stop mysql 進入 mysql u root p mysql h localhost u root p databasename 列出資料庫 show databases 選擇資料庫 use databasename 列出 show tables...