Jump to content

Link to database cannot be established. Error Help Needed


Recommended Posts

Dear Friends,

Due to some issues I have changed my hosting provider. I have copied all installed files which are available in public_html to my new hosting accounts folder. But I am getting error massage as "Link to database cannot be established." So can anyone tell me solution for it? How to copy paste old database to new one?

Regards
Vilas

Link to comment
Share on other sites

Hi Rocky,

Thanks for info. But could you please tell me how to export whole database from phpMy admin? Also do I have to create same name database which I have created in old hosting account?

Please suggest me.

Regards
Vilas

Link to comment
Share on other sites

You should click the Export tab in phpMyAdmin, select all the tables if they aren't already selected, choose the "GZIP" option, then click the "Go" button in the bottom-right corner to download the database. See the screenshot. You can then click the Import tab on the other database, then upload the database you downloaded. I don't think it matters if the databases have different names, though you will to edit config/settings.inc.php to let PrestaShop know that you are using a different database name.

EDIT: It seems images can't be attached to posts at this time. This happens on the forums from time to time for some reason.

Link to comment
Share on other sites

Hi Rocky,

Actually I am unable now to login to old database So is there is any other way to copy old database data to new one? Or what if I want to do new database? How to create that one? I have copied my all installed files of old public_html to new one. But only database is missing. So to create new database what is easy way to do it?

Regards
Vilas

Link to comment
Share on other sites

If you want to start over with a clean database without your old data, just delete config/settings.inc.php, then upload the install directory and run the installer. Note that you will need to re-add all your products and reinstall your modules in all the same positions as your old site before your site will look the same as it did before.

Link to comment
Share on other sites

  • 3 weeks later...

Hello,


I am having a problem with the export import feature. I do the export gz like you said however when I try to import it with phpmyadmin I get this error.

Error
SQL query:

-- -- Dumping data for table `ps_access` -- INSERT INTO `ps_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES (1, 1, 1, 1, 1, 1), (1, 2, 1, 1, 1, 1), (1, 3, 1, 1, 1, 1), (1, 4, 1, 1, 1, 1), (1, 5, 1, 1, 1, 1), (1, 6, 1, 1, 1, 1), (1, 7, 1, 1, 1, 1), (1, 8, 1, 1, 1, 1), (1, 9, 1, 1, 1, 1), (1, 10, 1, 1, 1, 1), (1, 11, 1, 1, 1, 1), (1, 12, 1, 1, 1, 1), (1, 13, 1, 1, 1, 1), (1, 14, 1, 1, 1, 1), (1, 15, 1, 1, 1, 1), (1, 16, 1, 1, 1, 1), (1, 17, 1, 1, 1, 1), (1, 18, 1, 1, 1, 1), (1, 19, 1, 1, 1, 1), (1, 20, 1, 1, 1, 1), (1, 21, 1, 1, 1, 1), (1, 22, 1, 1, 1, 1), (1, 23, 1, 1, 1, 1), (1, 24, 1, 1, 1, 1), (1, 26, 1, 1, 1, 1), (1, 27, 1, 1, 1, 1), (1, 28, 1, 1, 1, 1), (1, 29, 1, 1, 1, 1), (1, 30, 1, 1, 1, 1), (1, 31, 1, 1, 1, 1), (1, 32, 1, 1, 1, 1), (1, 33, 1, 1, 1, 1), (1, 34, 1, 1, 1, 1), (1, 35, 1, 1, 1, 1), (1, 36, 1, 1, 1, 1), (1, 37, 1, 1, 1, 1), (1, 38, 1, 1, 1, 1), (1, 39, 1, 1, 1, 1), (1, 40, 1, 1, 1, 1), (1, 41, 1, 1, 1, 1), (1, 42, 1, 1, 1, 1), (1, 43, 1, 1[...]

MySQL said:

#1062 - Duplicate entry '1-1' for key 1

I dont see what I can be doing wrong.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...