更改mysql数据库地址 [英] changing mysql database address

查看:70
本文介绍了更改mysql数据库地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我 1 小时前问过这个问题:

I asked this question 1 hour ago:

如何将我的数据从一个数据库 (000webhosting.com) 传输到另一个 (shatellhost.com)?注意:我使用 000webhosting.com 免费托管服务,我无法创建完整备份.我的数据是 phpfox 社交网络.

How can I transfer my data from one database(000webhosting.com) to another(shatellhost.com)? note: I use 000webhosting.com free hosting service and I can't create full backup. my data is phpfox social networking.

没有人回答所以我这样做了:

No one answered so I did this:

我将 000webhosting.com 中 public-html 中的全部数据传输(下载)到我的计算机,然后将整个数据上传到我在 shotellhost.com 中的新主机的 public-html,然后当我尝试打开我的网站时:www.ibiology.ir 这出现:

I transfered (download) whole data in public-html in 000webhosting.com to my computer and then uploded whole that to public-html of my new host in shotellhost.com, then when i try to open my site: www.ibiology.ir this appears:

Cannot connect to the database:
Can't connect to MySQL server on 'mysql5.000webhost.com' (4)

如何将 MySQL 地址更改为新的 MySQL?

How can i change MySQL address to new MySQL?

推荐答案

做一个 mysqldump 然后将 SQL 导入到新数据库中.

Do a mysqldump and then import the SQL into your new database.

备份:#mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

恢复:# mysql -u root -p[root_password] [database_name] <转储文件名.sql

restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql

这篇关于更改mysql数据库地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆