将数据库从本地导入至MySQL

Loading the Database
当我们download一些db文件到本地时,我们要想在mysql中看到这些db文件,需要做导入工作。
Loading and Saving Databases
To load a database file, open a command prompt, and change to the directory
that the file is stored in. Then run the following command (replacing username
and filename with the appropriate names):
【从本地导入到mysql中】
mysql -u username - p(root需要密码) < filename.db
EG:mysql -u root -p < employee.db
等到回车后提示输入密码时再输入密码
【从mysql中导入本地】
To save a database from MySQL to a file, open a command prompt and type the
following (replacing username , databasename and filename with the appropriate
names):
mysqldump -u username - p(root需要密码) -B databasename > filename.db
每次有新的db都需要按照此操作向mysql中导入。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值