mysql 導(dǎo)入導(dǎo)出數(shù)據(jù)庫、數(shù)據(jù)表的方法
Linux下
均在控制臺下操作。宇塵網(wǎng)絡(luò)幫助中心域名知識|虛擬主機知識|VPS主機知識|服務(wù)器知識|網(wǎng)站建設(shè)知識|網(wǎng)絡(luò)推廣
導(dǎo)入數(shù)據(jù)庫:
前提:數(shù)據(jù)庫和數(shù)據(jù)表要存在(已經(jīng)被創(chuàng)建)仿牌空間、香港月付空間、韓國月付空間、日本月付空間、荷蘭VPS、香港VPS
(1)將數(shù)據(jù)表 test_user.sql 導(dǎo)入到test 數(shù)據(jù)庫的test_user 表中
[root@test ~]# mysql -uroot -p test < /www/web/test/test_user.sql
(2) 將數(shù)據(jù)庫 test.sql 導(dǎo)入到 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
導(dǎo)出數(shù)據(jù)庫: 美國月付空間、月付美國空間、美國VPS、美國服務(wù)器租用
(1) 將數(shù)據(jù)庫 test 導(dǎo)出到/www/web/test/test.sql
[root@test ~]# mysqldump -uroot -p test > /www/web/test/test.sql
回車后提示輸入密碼
(2) 將數(shù)據(jù)庫 test 中的 user 數(shù)據(jù)表 導(dǎo)出到 /www/web/test/user.sql
[root@test ~]# mysqldump -uroot -p test user < /www/web/test/user.sql
更多技術(shù)知識,更多網(wǎng)絡(luò)服務(wù),盡在宇塵網(wǎng)絡(luò)。我們的成長,離不開你們的支持,宇塵網(wǎng)絡(luò),歡迎您的訪問。