Jump to content

Link to database cannot be established + Where are the files ?…


fongor

Recommended Posts

Hello,

I have to handle the finishing of a prestashop website that is almost done and it's the first time I ever use prestashop, + I'm not very familiar with php and mysql

 

I have to questions :

 

1 - When I launch MAMP, and get to http://localhost:8888/www/<mysite>/index.php, I get only this :

 

Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user 'pshop'@'localhost' (using password: YES)

 

Any idea where I must look and what to change ?

 

I've been reading a couple of posts about it but couldn't find my answer

 

 

2 - I have to change some layout things, add some links, placeholders, these kind of things… i've been reading a good part of the doc but it remains a sort of mystery, where and what are the files I have to open ? Are they the themes/theme/<name>.tpl ? So they are written using smarty ? so I should get into php to handle them ?

 

Thank you very much in advance for your answers

 

best

 

Link to comment
Share on other sites

Hello.

1.
- It is necessary to attach a user to the database.
- If you are migrating a site, then you need to specify the correct host name, database name, user name, user password in a file config/settings.php
2. Yes. Main theme files.

  • Like 1
Link to comment
Share on other sites

Thank you

 

- It is necessary to attach a user to the database.

 

how do i do this ?

 

 

 

you need to specify the correct host name, database name, user name, user password in a file config/settings.php

 

Prestashop's email says :

 

MySQL admin account         : root
MySQL admin password   : <adminpw>

MySQL database for Prestashop   : prestashop
MySQL account for the Prestashop base   : pshop
Password for the Prestashop MySQL account : <pw>

 

and in config/settings.php I have :

 

<?php
define('_DB_SERVER_', 'localhost');
define('_DB_NAME_', 'ps5');
define('_DB_USER_', 'pshop');
define('_DB_PASSWD_', '(…)');

 

so instead I just change ps5 into prestashop, am I right ?

 

but none of them works…

Link to comment
Share on other sites

define('_DB_SERVER_', 'localhost');
define('_DB_NAME_', 'prestashop');
define('_DB_USER_', 'pshop');
define('_DB_PASSWD_', '');

 

if user 'pshop' haven't password

 
Check in database manager that the user 'pshop' is attached to the database 'prestashop' and has all rights.
Link to comment
Share on other sites

 

define('_DB_SERVER_', 'localhost');

define('_DB_NAME_', 'prestashop');

define('_DB_USER_', 'pshop');

define('_DB_PASSWD_', '');

 

if user 'pshop' haven't password

 
Check in database manager that the user 'pshop' is attached to the database 'prestashop' and has all rights.

 

as it does have a password, what do you suggest ?

Link to comment
Share on other sites

define('_DB_SERVER_', 'localhost');

define('_DB_NAME_', 'prestashop');

define('_DB_USER_', 'pshop');

define('_DB_PASSWD_', 'password');

 

If not, drop me a private message.

 

nope… ok thanks, I'm sending you a private mess

Link to comment
Share on other sites

Hello,

This is an urgent request, I'm taking back this thread and all the informations follow below in this post

I have to handle the finishing of a prestashop website that is almost done and it's the first time I ever use prestashop, + I'm not very familiar with php and mysql

When I launch MAMP Pro, and get to http://localhost:8888/www/<mysite>/index.php, I get only this :

Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user 'pshop'@'localhost' (using password: YES)

Prestashop's email says :

MySQL admin account : root
MySQL admin password : <adminpw>

MySQL database for Prestashop : prestashop
MySQL account for the Prestashop base : pshop
Password for the Prestashop MySQL account : <pw>

and in config/settings.php I have :

<?php
define('_DB_SERVER_', 'localhost');
define('_DB_NAME_', 'ps5');
define('_DB_USER_', 'pshop');
define('_DB_PASSWD_', '<pw>');

so I just changed ps5 into prestashop, but none of them works

 

is it normal that they are different ? Is there another file where this appears and I should change it to harmonize everything ?

Inside phpmyadmin > left pannel > prestashop
> right bar, "privileges", and there I check the users :

User "pshop" on client "localhost", type "global", has all privileges, but has no "Grant", and I can't set it to yes :

GRANT ALL PRIVILEGES ON *.* TO 'pshop'@'localhost'WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;

#1045 - Access denied for user 'pshop'@'localhost' (using password: YES)

 

And,

mysql_error.log file in Mamp pro says :

160408 0:14:08 [Note] /Applications/MAMP/Library/bin/mysqld: Normal shutdown

160408 0:14:08 [Note] Event Scheduler: Purging the queue. 0 events
160408 0:14:08 InnoDB: Starting shutdown...
160408 0:14:09 InnoDB: Shutdown completed; log sequence number 50703588
160408 0:14:09 [Note] /Applications/MAMP/Library/bin/mysqld: Shutdown complete

160408 00:14:09 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
160408 10:10:21 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql
160408 10:10:21 [Warning] Setting lower_case_table_names=2 because file system for /Library/Application Support/appsolute/MAMP PRO/db/mysql/ is case insensitive
160408 10:10:21 [Note] Plugin 'FEDERATED' is disabled.
160408 10:10:21 InnoDB: The InnoDB memory heap is disabled
160408 10:10:21 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160408 10:10:21 InnoDB: Compressed tables use zlib 1.2.3
160408 10:10:21 InnoDB: Initializing buffer pool, size = 128.0M
160408 10:10:21 InnoDB: Completed initialization of buffer pool
160408 10:10:21 InnoDB: highest supported file format is Barracuda.
160408 10:10:22 InnoDB: Waiting for the background threads to start
160408 10:10:23 InnoDB: 5.5.42 started; log sequence number 50703588
160408 10:10:23 [Note] Event Scheduler: Loaded 0 events
160408 10:10:23 [Note] /Applications/MAMP/Library/bin/mysqld: ready for connections.
Version: '5.5.42' socket: '/Applications/MAMP/tmp/mysql/mysql.sock' port: 0 Source distribution

Apache error log says :

[Fri Apr 08 00:14:10 2016] [notice] caught SIGTERM, shutting down
[Fri Apr 08 10:05:20 2016] [notice] Digest: generating secret for digest authentication ...
[Fri Apr 08 10:05:20 2016] [notice] Digest: done
[Fri Apr 08 10:05:21 2016] [notice] FastCGI: process manager initialized (pid 492)
[Fri Apr 08 10:05:21 2016] [notice] Apache/2.2.29 (Unix) mod_wsgi/3.5 Python/2.7.10 PHP/5.6.10 mod_ssl/2.2.29 OpenSSL/0.9.8za DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.22.0 configured -- resuming normal operations

and php error log says nothing about today where i still have my problem


can it be a problem in my mamp pro config ?

• In mamp pro there is a MySQL tab and there is a button "change the root password", should I do it ?

It says "for safety reasons the password of the "root" mysql user must be changed when you connect to the internet"

but I'm just trying to work locally so I don't think I should do this ?

• Still in Mamp pro, I have a choice :

Execute Apache/MySQL server as a user :

- jeremieg (Apache) / jeremieg (MySQL)

(jeremieg is my name and my mac book name)

or :

- www(Apache) / mysql (MySQL) > This one is choosen by default

(none of them works anyway)

• Still in Mamp Pro :

- Default Apache port for http connections : 8888

- Default Apache port for https connections (SSL) : 8890

- MySQL port : 8889

But still, today when I clicked on "start the servers" in Mamp, because Apache was on but MySQL was off after I launched Mamp,

I had an alert saying port 80 was already used (strange because I was not asking for port 80), and that it could cause conflict with one of my virtual machines and so I should change the port ; but I chose "Start the servers anyway" and it launched MySQL

I also tried loading the index.php after disabling little snitch, just in case (and emptying cache), but it didn't change

any idea ?…

This is quite urgent, Thank you very much+++

Link to comment
Share on other sites

MySQL admin account : root

MySQL admin password : <adminpw>

 

MySQL database for Prestashop : prestashop

MySQL account for the Prestashop base : pshop

Password for the Prestashop MySQL account : <pw>

 

and in config/settings.php I have :

 

<?php

define('_DB_SERVER_', 'localhost');

define('_DB_NAME_', 'ps5');

define('_DB_USER_', 'pshop');

define('_DB_PASSWD_', '<pw>');

 

Hi,

 

do you test with mysql root user ?

Link to comment
Share on other sites

Hi,

 

do you test with mysql root user ?

 

Thank you yes now I'm testing with root but now it says

 

Link to database cannot be established: SQLSTATE[HY000] [1049] Unknown database 'prestashop'

 

or

 

Link to database cannot be established: SQLSTATE[HY000] [1049] Unknown database 'ps5',

 

depending on which I refer too, both don't work…

 

any idea ?……

Link to comment
Share on other sites

When I click on "Users" from the right bar (not after entering one of the databases such as ps5 or prestashop), I get this : is this normal ??


Utilisateur    Client    Mot de passe    Privilèges globaux     Groupe d'utilisateurs    «Grant»    Action

debian-sys-maint    localhost    Oui    ALL PRIVILEGES     
Oui    Changer les privilèges Changer les privilèges    Exporter Exporter

phpmyadmin    localhost    Oui    USAGE    
Non    Changer les privilèges Changer les privilèges    Exporter Exporter

prestashop    localhost    Non    USAGE    
Non    Changer les privilèges Changer les privilèges    Exporter Exporter

pshop    localhost    Oui    ALL PRIVILEGES     
Non    Changer les privilèges Changer les privilèges    Exporter Exporter

root    127.0.0.1    Oui    ALL PRIVILEGES     
Oui    Changer les privilèges Changer les privilèges    Exporter Exporter

root    ::1    Oui    ALL PRIVILEGES     
Oui    Changer les privilèges Changer les privilèges    Exporter Exporter

root    localhost    Oui    ALL PRIVILEGES     
Oui    Changer les privilèges Changer les privilèges    Exporter Exporter

root    vps256453.ovh.net    Oui    ALL PRIVILEGES     
Oui    Changer les privilèges Changer les privilèges    Exporter Exporter



and if I try to give all privileges except grant to user prestashop, it says :




GRANT ALL PRIVILEGES ON *.* TO 'prestashop'@'localhost'WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
MySQL a répondu: Documentation

#1045 - Access denied for user 'pshop'@'localhost' (using password: YES)






Apart this, this is what I have :






Users accessing "prestashop"



Utilisateur    Client    Type    Privilèges    «Grant»    Action
debian-sys-maint    localhost    global    ALL PRIVILEGES    Oui    Changer les privilèges Changer les privilèges
pshop    localhost    global    ALL PRIVILEGES    Non    Changer les privilèges Changer les privilèges
root    127.0.0.1    global    ALL PRIVILEGES    Oui    Changer les privilèges Changer les privilèges
root    ::1    global    ALL PRIVILEGES    Oui    Changer les privilèges Changer les privilèges
root    localhost    global    ALL PRIVILEGES    Oui    Changer les privilèges Changer les privilèges
root    vps256453.ovh.net    global    ALL PRIVILEGES    Oui    Changer les privilèges Changer les privilèges








Users accessing "ps5"





Utilisateur    Client    Type    Privilèges    «Grant»    Action
debian-sys-maint    localhost    global    ALL PRIVILEGES    Oui    Changer les privilèges Changer les privilèges
pshop    localhost    global    ALL PRIVILEGES    Non    Changer les privilèges Changer les privilèges
root    127.0.0.1    global    ALL PRIVILEGES    Oui    Changer les privilèges Changer les privilèges
root    ::1    global    ALL PRIVILEGES    Oui    Changer les privilèges Changer les privilèges
root    localhost    global    ALL PRIVILEGES    Oui    Changer les privilèges Changer les privilèges
root    vps256453.ovh.net    global    ALL PRIVILEGES    Oui    Changer les privilèges Changer les privilèges




in settings.inc.php :





<?php
define('_DB_SERVER_', 'localhost:8888');
define('_DB_NAME_', 'prestashop');
define('_DB_USER_', 'root');
define('_DB_PASSWD_', 'root');



originally I had :



<?php
define('_DB_SERVER_', 'localhost');
define('_DB_NAME_', 'ps5');
define('_DB_USER_', 'pshop');
define('_DB_PASSWD_', '(<password>');



and I tried with prestashop instead of ps5 for db name too


how does it look to you  ??

thank you

 

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