Home > Database > Mysql Tutorial > body text

如何将远程服务器MYSQL数据库导出导入_MySQL

WBOY
Release: 2016-06-01 13:11:29
Original
1054 people have browsed it

MYSQL数据库导出第一种利用空间商提供的PHPMYADMIN管理工具导出,这种较为简单,大家查一下资料这里就不多讲了.
第二种利用MYSQL安装时自带的mysqldump管理工具导出:
1)左下角开始菜单-运行-CMD进入DOS命令行状态
2)输入:CD D:/Program Files/MySQL/MySQL Server 5.0/bin
D:/Program Files/MySQL/MySQL Server 5.0/bin为你安装的MYSQL安装目录,/bin为mysqldump管理工具所有在的目录;
3)导出语法为:
mysqldump -h[hosname] -u[user_name] -p[password] –default-character-set=[char_set_name] [db_name] [save_path]
例:然后输入:mysqldump -h119.12.12.11 -umysql-pmysql123–default-character-set=utf8 aspchina –skip-lock-tables d:/aspchina_net.sql
119.12.12.11为远程服务器IP,-umysql mysql为数据库用户名,-pmysql123 mysql123 为用户密码,set=utf8为导出MYSQL的编码格式,aspchina为要导出的数据库名,d:/aspchina_net.sql 为导入到你本地的存放路径,aspchina_net.sql你可以自由命名!
MYSQL数据库导入
如果MYSQL数据库小于2MB可以用mysqldump管理工具导入,如果大小2MB就不行了,因为空间商提供的PHPMYADMIN管理工具一般只能导入小于2MB的数据,这令一些使用MYSQL数据库的站长郁闷了!
1)左下角开始菜单-运行-CMD进入DOS命令行状态
2)D:/Program Files/MySQL/MySQL Server 5.0/bin为你安装的MYSQL安装目录,/bin为mysqldump管理工具所有在的目录;
3)然后输入:mysql -h119.12.12.11 -uaspchina -paspchina123456 aspchina注释:aspchina_net.sql,如果用户没有创建数据库的权限将不能导入aspchina_net.sql数据库,否则spchina_net.sql只能是多张表不然会出错,这点切记!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template