mysql数据库移植到另一台电脑,将mysql数据库从一台计算机复制到另一台计算机...

I want to copy my mysql database from my computer to another computer. How can I do this?

解决方案

How to copy Mysql database from one Computer to another / backup database using mysqldump

We can transfer a MySQL database from one PC to another PC using

mysqldump command.

We have to create dump file of database to transfer database from

one PC to another PC.

MySQL database is not portable database i.e. we cannot transfer it

from one PC to another PC by copying and pasting it.

We can use following method to transfer database.

Creating a dumpfile from database/ Taking backup of MySQL database:

Open command prompt.

Execute following commands to change directory

c: “press enter”

cd program files/MySQL/MySQL Server 5.1/ bin “press enter”

mysqldump -u root -p database_name > database_name.sql “press enter”

Enter password: password of MySQL

Copy sql file and paste it in PC where you want to transfer database.

2. Dumping sql file into database:-

- Open MySQL command line client command prompt.

- Execute following command to create database.

create database database_name;

“press enter” Database name is must as that of your database_name.

Copy that sql file into location “c:/program files/MySQL/MySQL Server 5.1/bin”

*- Now open command prompt and execute following commands.*

>C: “press enter”

>cd program files/MySQL/MySQL Server5.1/bin “press enter”

>mysql –u root –p database_name < database_name.sql “press enter”

Your database is created on PC.

Now in MySQL command prompt check your database.

Another one:1

This best and the easy way is to use a db tools(SQLyog)

With this tools you can connect the 2 databases servers and just copy one database on server a to server b.

For more info

800f749ad166b395962b4323a782039d.png

Another one:2

Try something like this:

mysqldump -u root -p lbry > dump-lbry.sql

Then to import it:

mysql -u root -p < dump-lbry.sql

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值