将数据库导入 phpmyadmin #1044 - 用户访问被拒绝
我最近在 Godaddy 购买了网络托管服务.我已经完成了我的项目并且我使用了 xampp.现在我想导入我已经拥有的数据库.我尝试通过单击导入并选择文件以正常方式执行此操作.但我收到此错误
>
我该如何解决这个问题?
解决方案许多网络主机只允许您访问一个数据库.您的 SQL 文件正在尝试创建一个新数据库(在顶部附近有一行类似于 CREATE DATABASE `socialnew`...
,如您在错误消息中看到的那样).
可能的解决方案是不从您的脚本创建数据库.您可以手动编辑 .sql 文件并删除以 CREATE DATABASE `socialnew`...
和 USE `socialnew`;
开头的行,或者,如果您的 phpMyAdmin 是非常最新,您可以从 XAMPP 再次导出,并确保未选中添加 CREATE DATABASE/USE 语句"复选框.
然后在进行导入时,请确保您从要导入到的数据库中选择导入"选项卡.
I have recently purchased web hosting service at godaddy. I have already completed my project and i used xampp. Now i want to import the database which i arleady have. I tried to do it in the normal way by clicking on import and choosing the file. But i'm getting this error
How can I fix this?
解决方案Many web hosts only give you access to one database. Your SQL file is trying to create a new database (with a line near the top like CREATE DATABASE `socialnew`...
as you see in the error message).
The likely solution is to not create the database from your script. You can either edit the .sql file manually and remove the lines starting with CREATE DATABASE `socialnew`...
and USE `socialnew`;
, or, if your phpMyAdmin is pretty up-to-date, you could do the export again from your XAMPP and make sure the checkbox is not selected for "Add CREATE DATABASE / USE statement".
Then when doing the import, make sure you're selecting the Import tab from within the database you wish to import to.
相关文章