Jump to content

[SOLVED] Link to database cannot be established.


Recommended Posts

Two weeks ago I installed Prestashop and all worked fine.
I put in some categories and products

Today I want to work on my webshop but the only thing I get is

"Link to database cannot be established."

In both front- and backoffice
Is there a way I can enter my webshop again?

Link to comment
Share on other sites

I've seen others has the same problem when the cookies are cleared.

I use regular CCLEANER which cleans all cookies... But if a visitor use a cookiecleaner she/he cann't visit my shop anymore???

anyway I still cann't enter my webshop :((

Link to comment
Share on other sites

Hello roxette,

If you get the message ( link to database can not established ) then most off the time your shop info don`t match your database info.

So browse to your files with ftp client or true Cpanel if you have and go to the following folder, /public_html/config/ then open this file settings.inc.php
You see this info there,

<?php

define('__PS_BASE_URI__', '/');
define('_THEME_NAME_', 'your_theme');
define('_DB_NAME_', 'your_database_name');
define('_DB_SERVER_', 'localhost');
define('_DB_USER_', 'your_database_username');
define('_DB_PREFIX_', 'ps_');
define('_DB_PASSWD_', 'your_password');
define('_DB_TYPE_', 'MySQL');
define('_COOKIE_KEY_', 'It,s already there and should work');
define('_COOKIE_IV_', 'Do not change the info thats already there');
define('_PS_VERSION_', 'your prestashop version number');

?>




Most off the time if you get this error then the database name in (settings.inc.php ) don`t match the database name on your server.
So first check if the database name on your server is the same as the one in settings.inc.php if not then rename it in settings.inc.php to the one thats on your hosting server.

Also check if your user and pass is correct.

ysco..

Link to comment
Share on other sites

I was trying to find a solution to get past stage 3 of the installation where it cannot find the server/database - which is all correct.

Do I have to type the full url for the database server name?

Also per your instructions I checked and I do not have this file 'settings.inc.php'

Link to comment
Share on other sites

@ jdmorrisn

What are you try to do exactly ?
A clean install off PS 1.3.1 and then try to use your existing database ?
Or a clean install with a new database ?

Note:

If you do a clean install off 1.3.1 and then import your database from a earlier PS version is not recommended .
The database structure from 1.3.1 is different then 1.2.xx so in this case you must do a upgrade otherwise you will get a lot off problems and stuff that don`t work correct.

If it ask for your details like ,

User
pass
database

Always fill in the correct details,

So if your database name is prestashop_newsite then you also fill in those details at step 3 as same as user and pass otherwise it won`t work.


ysco..

Link to comment
Share on other sites

  • 2 months later...

I also had the problem; “Link to database cannot be established”.

As proposed here and elsewhere, I changed the password in config/settings.inc.php manually back to the emailed password, but I still could not enter the site or the admin-page.

The solution for me was to change the password (also) of the database (mySql or php -I forgot) through my webhosting admin site (one.com).

PreHistory:
After I received a mail with a new password I got in to admin-page. As soon as I entered a new password in Tools/Preferences, I got kicked off with “Link to database cannot be established”.

Link to comment
Share on other sites

  • 9 months later...
Hello roxette,

If you get the message ( link to database can not established ) then most off the time your shop info don`t match your database info.

So browse to your files with ftp client or true Cpanel if you have and go to the following folder, /public_html/config/ then open this file settings.inc.php
You see this info there,

<?php

define('__PS_BASE_URI__', '/');
define('_THEME_NAME_', 'your_theme');
define('_DB_NAME_', 'your_database_name');
define('_DB_SERVER_', 'localhost');
define('_DB_USER_', 'your_database_username');
define('_DB_PREFIX_', 'ps_');
define('_DB_PASSWD_', 'your_password');
define('_DB_TYPE_', 'MySQL');
define('_COOKIE_KEY_', 'It,s already there and should work');
define('_COOKIE_IV_', 'Do not change the info thats already there');
define('_PS_VERSION_', 'your prestashop version number');

?>




Most off the time if you get this error then the database name in (settings.inc.php ) don`t match the database name on your server.
So first check if the database name on your server is the same as the one in settings.inc.php if not then rename it in settings.inc.php to the one thats on your hosting server.

Also check if your user and pass is correct.

ysco..

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...