Linux下mysql數據庫重新導入

   切換到sql語句所在的目錄

   >mysql -uroot -p  -e "drop database if exists testdb";

   Input your password:>

   >mysql -utest -p  -e "create database testdb";

   Input your password:>

   >mysql -uroot -p -e "grant all on testdb.* to 'test@localhost' identified by 'test' "

   >mysql -utest -ptest testdb < testdb.sql

 

   Linux常用到的幾個命令:

   1. rm -rf  test   //刪除test文件夾及文件夾下的所有文件

   2. wget(遠程下載文件到服務器上)

   3. cp -rpf .test1/* test2 將test1文件夾中的所有文件拷貝到其上級目錄test2中

   4. ssh 10.0.0.1 遠程登錄到某臺機器

發佈了125 篇原創文章 · 獲贊 8 · 訪問量 27萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章