mysql數據庫的系統操做基本操做

本文主要總結並記錄一下簡單且經常使用的mysql 在cmd 窗口中操做的基本命令mysql

命令中止mysql 數據庫服務sql

1.(cmd)命令行數據庫

啓動:net start mysql
中止:net stop mysql

 

2.手動: 1. 使用快捷鍵 ctr+alt+delete  =》2. 啓動任務管理器=》3. 進入服務 =》4.找到mysql 將其啓動/關閉服務器

 


3.登陸/退出mysql系統spa

登陸:mysql -h服務器路徑 -u登陸名 -p

或者登陸:mysql --host=服務器地址 --user=用戶名 --port=端口 --password

例子:mysql -hlocalhost -uroot -p

或者:mysql --host=hlocalhost --user=root --port=3066 --password=123456
//(注意:前提是系統環境設置好)

 

4.備份與恢復命令行

//4.1備份:
語法:mysqldump -h服務器地址 -u登陸名 -p 數據庫名> 文件名
例子:mysqldump -hlocalhost -uroot db>e:/db.sql

//4.2恢復:
語法:mysql -h服務器地址 -u登陸名 -p 數據庫名<文件名
例子:mysql -hlocahost -uroot -p db2<e:/db.sql
相關文章
相關標籤/搜索