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
我最近在godaddy购买了网络托管服务。我已经完成了我的项目,我使用了xampp。现在我想导入我arleady的数据库。我试图通过单击导入并选择文件以正常方式执行此操作。但是我收到了这个错误
How can I fix this?
我怎样才能解决这个问题?
4 个解决方案
#1
15
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).
许多Web主机只允许您访问一个数据库。您的SQL文件正在尝试创建一个新数据库(顶部附近的行如CREATE DATABASE`socialnew` ...正如您在错误消息中看到的那样)。
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".
可能的解决方案是不从脚本创建数据库。您可以手动编辑.sql文件并删除以CREATE DATABASE`socialnew` ...和USE`socialnew`;开头的行,或者,如果您的phpMyAdmin是最新的,您可以再次从导出您的XAMPP并确保未选中“添加CREATE DATABASE / USE语句”复选框。
Then when doing the import, make sure you're selecting the Import tab from within the database you wish to import to.
然后在执行导入时,请确保从要导入的数据库中选择“导入”选项卡。
#2
0
You may also open the .sql file in an IDE and just delete the create command.Then, assuming you've navigated to the desired DB import section in phpMyAdmin, you can run the import with the modified file and you should be good to go.
您也可以在IDE中打开.sql文件,然后删除create命令。然后,假设您已经导航到phpMyAdmin中所需的数据库导入部分,您可以使用修改后的文件运行导入,您应该很高兴去。
#3
0
Must Ensure that your User_Name, Password and Database name are correct. If you are Deal with database 'sampled' then type 'sampled' in query instead of 'db' also must ensure that you don't have to use quota(') in Statement. For More and Accurate Detail visit Following link: http://onephin.com/1044-access-denied-user-user_namelocalhost-database-database_name/
必须确保您的User_Name,密码和数据库名称正确无误。如果您正在处理数据库'samples',那么在查询中键入'sampled'而不是'db'也必须确保您不必在Statement中使用quota(')。详细信息请访问以下链接:http://onephin.com/1044-access-denied-user-user_namelocalhost-database-database_name/
#4
-1
Export and import just tables of the database:
仅导出和导入数据库的表:
-> open the database in phpmyadmin
-> click to export
-> save the file (you don't have to change any settings)
-> open the database on new server
-> click to import
-> chose the file
-> click to "GO" and you are done...
- >在phpmyadmin中打开数据库 - >点击导出 - >保存文件(你不必更改任何设置) - >在新服务器上打开数据库 - >点击导入 - >选择文件 - >点击到“GO”,你完成了......
It was working for me :-)
它对我有用:-)
#1
15
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).
许多Web主机只允许您访问一个数据库。您的SQL文件正在尝试创建一个新数据库(顶部附近的行如CREATE DATABASE`socialnew` ...正如您在错误消息中看到的那样)。
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".
可能的解决方案是不从脚本创建数据库。您可以手动编辑.sql文件并删除以CREATE DATABASE`socialnew` ...和USE`socialnew`;开头的行,或者,如果您的phpMyAdmin是最新的,您可以再次从导出您的XAMPP并确保未选中“添加CREATE DATABASE / USE语句”复选框。
Then when doing the import, make sure you're selecting the Import tab from within the database you wish to import to.
然后在执行导入时,请确保从要导入的数据库中选择“导入”选项卡。
#2
0
You may also open the .sql file in an IDE and just delete the create command.Then, assuming you've navigated to the desired DB import section in phpMyAdmin, you can run the import with the modified file and you should be good to go.
您也可以在IDE中打开.sql文件,然后删除create命令。然后,假设您已经导航到phpMyAdmin中所需的数据库导入部分,您可以使用修改后的文件运行导入,您应该很高兴去。
#3
0
Must Ensure that your User_Name, Password and Database name are correct. If you are Deal with database 'sampled' then type 'sampled' in query instead of 'db' also must ensure that you don't have to use quota(') in Statement. For More and Accurate Detail visit Following link: http://onephin.com/1044-access-denied-user-user_namelocalhost-database-database_name/
必须确保您的User_Name,密码和数据库名称正确无误。如果您正在处理数据库'samples',那么在查询中键入'sampled'而不是'db'也必须确保您不必在Statement中使用quota(')。详细信息请访问以下链接:http://onephin.com/1044-access-denied-user-user_namelocalhost-database-database_name/
#4
-1
Export and import just tables of the database:
仅导出和导入数据库的表:
-> open the database in phpmyadmin
-> click to export
-> save the file (you don't have to change any settings)
-> open the database on new server
-> click to import
-> chose the file
-> click to "GO" and you are done...
- >在phpmyadmin中打开数据库 - >点击导出 - >保存文件(你不必更改任何设置) - >在新服务器上打开数据库 - >点击导入 - >选择文件 - >点击到“GO”,你完成了......
It was working for me :-)
它对我有用:-)