mysql導入導出數(shù)據(jù)庫、數(shù)據(jù)表的方法
來源:懂視網(wǎng)
責編:小采
時間:2020-11-09 21:05:07
mysql導入導出數(shù)據(jù)庫、數(shù)據(jù)表的方法
mysql導入導出數(shù)據(jù)庫、數(shù)據(jù)表的方法:Linux下均在控制臺下操作。導入數(shù)據(jù)庫:前提:數(shù)據(jù)庫和數(shù)據(jù)表要存在(已經(jīng)被創(chuàng)建) (1)將數(shù)據(jù)表 test_user.sql 導入到test 數(shù)據(jù)庫的test_user 表中[root@test ~]# mysql -uroot -p test < /www/web/test/test_user.sq
導讀mysql導入導出數(shù)據(jù)庫、數(shù)據(jù)表的方法:Linux下均在控制臺下操作。導入數(shù)據(jù)庫:前提:數(shù)據(jù)庫和數(shù)據(jù)表要存在(已經(jīng)被創(chuàng)建) (1)將數(shù)據(jù)表 test_user.sql 導入到test 數(shù)據(jù)庫的test_user 表中[root@test ~]# mysql -uroot -p test < /www/web/test/test_user.sq

Linux下
均在控制臺下操作。
導入數(shù)據(jù)庫:
前提:數(shù)據(jù)庫和數(shù)據(jù)表要存在(已經(jīng)被創(chuàng)建)
(1)將數(shù)據(jù)表 test_user.sql 導入到test 數(shù)據(jù)庫的test_user 表中
[root@test ~]# mysql -uroot -p test < /www/web/test/test_user.sql
(2) 將數(shù)據(jù)庫 test.sql 導入到 test 數(shù)據(jù)庫test 中
[root@test ~]# mysql -uroot -p test < /www/web/test/test.sql
(3)source命令不在控制臺下,要進入mysql下操作
mysql> use test;
mysql>source /www/web/test/test.sql
導出數(shù)據(jù)庫:
(1) 將數(shù)據(jù)庫 test 導出到/www/web/test/test.sql
[root@test ~]# mysqldump -uroot -p test > /www/web/test/test.sql
回車后提示輸入密碼
(2) 將數(shù)據(jù)庫 test 中的 user 數(shù)據(jù)表 導出到 /www/web/test/user.sql
[root@test ~]# mysqldump -uroot -p test user < /www/web/test/user.sql
您可能感興趣的文章:
MYSQL 數(shù)據(jù)庫導入導出命令mysql導入導出數(shù)據(jù)中文亂碼解決方法小結MySQL 文本文件的導入導出數(shù)據(jù)的方法MYSQL導入導出命令詳解MySQL數(shù)據(jù)庫導出與導入及常見錯誤解決Mysql 導入導出csv 中文亂碼問題的解決方法MySQL導入導出.sql文件及常用命令小結mysql 導入導出數(shù)據(jù)庫以及函數(shù)、存儲過程的介紹Mysql導入導出工具Mysqldump和Source命令用法詳解Mysql導入導出時遇到的問題解決
聲明:本網(wǎng)頁內容旨在傳播知識,若有侵權等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
mysql導入導出數(shù)據(jù)庫、數(shù)據(jù)表的方法
mysql導入導出數(shù)據(jù)庫、數(shù)據(jù)表的方法:Linux下均在控制臺下操作。導入數(shù)據(jù)庫:前提:數(shù)據(jù)庫和數(shù)據(jù)表要存在(已經(jīng)被創(chuàng)建) (1)將數(shù)據(jù)表 test_user.sql 導入到test 數(shù)據(jù)庫的test_user 表中[root@test ~]# mysql -uroot -p test < /www/web/test/test_user.sq