j8snl Posted March 8, 2015 Share Posted March 8, 2015 Hi, I've been reading across the forums this morning and tried several of the suggestions I've seen but without luck, so creating my first post in the hope someone can assist me. Background: I am quite web savvy but I've never used Prestashop until this morning. A friend of mines wants to move his hosting to another host, he's asked me to help. We have the Prestashop backup and the full sql data. Rather than install Prestashop using Installatron on CPANEL then try to fit this in, here's the steps I done. In CPANEL 1. Created a MySQL Database 2. Created a User 3. Assigned a Password 4. Granted User access to Database (granted all permissions) In PHPMyAdmin 1. Imported the given SQL (was 60mb) so needed to break it down into 4 loads, but everything is loaded. In FTP 1. Uploaded the site content into /public_html/ In Settings.inc.php 1. changed - define('_DB_SERVER_', 'localhost'); 2. changed - define('_DB_NAME_', 'bagpipe_prestanew'); 3. changed - define('_DB_USER_', 'bagpipe_thenameofmyuser'); 4. changed - define('_DB_PASSWD_', 'thepasswordofmyuser'); I think that should be me done according to what I've read, but whenever I try to load the page I get an error: Link to database cannot be established: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client I'm unsure what to try now, here's a copy of the exact settings.inc.php that was in the backup set before I changed the above: <?php define('_DB_SERVER_', ''); define('_DB_NAME_', ‘’); define('_DB_USER_', ''); define('_DB_PASSWD_', ''); define('_DB_PREFIX_', 'ps_'); define('_MYSQL_ENGINE_', 'MyISAM'); define('_PS_CACHING_SYSTEM_', 'CacheMemcache'); define('_PS_CACHE_ENABLED_', '0'); define('_MEDIA_SERVER_1_', ''); define('_MEDIA_SERVER_2_', ''); define('_MEDIA_SERVER_3_', ''); define('_COOKIE_KEY_', 'sxgbCRDzoDE9MNI1aikv2ICjaPgy5K2xss6YHvvBCMbAznzIIRdhNj4z'); define('_COOKIE_IV_', 'IR6KiouP'); define('_PS_CREATION_DATE_', '2014-01-30'); define('_PS_VERSION_', '1.5.6.2'); define('_PS_DIRECTORY_', '/'); Now I spotted TWO things I didn't think were correct in this file the quoting on that DB_NAME ‘’ versus '' and there was no ?> to close the php. So, I've fixed those and used the new DB connection lines shown above, but no joys. The same error. I'm slightly confused when I look at the DB tables that I've imported some are type MyISAM and some are type InnoDB, I can only assume that's correct? The only thing I can add here that I think could be causing an issue, is at this moment we haven't transferred the domain name that the Prestashop was previously on over, I'm building this on the IP URL http://xx.xx.xx.xx/~bagpipe/ I don't think that should stop me seeing something and making a database connection though. Any help or suggestions from anyone would be very welcome Thanks in advance Jason Link to comment Share on other sites More sharing options...
j8snl Posted March 8, 2015 Author Share Posted March 8, 2015 Just as an addon as I'm still digging: Regarding the domain I found that I can change this in the ps_configuration table and edited both PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL from the domain name to the IP Address xx.xx.xx.xx/~bagpipe I also read about defining the location of Prestashop using define('__PS_BASE_URI__', '/'); This was missing from the supplied settings.inc.php file so I added it, not sure it mattered as its in the root anyway. Still looking............ Jason Link to comment Share on other sites More sharing options...
Rolige Posted March 8, 2015 Share Posted March 8, 2015 Not much to do, the error is clear and connection can't be established with database, you need inspect again, because clearly you have put a wrong data connection. Link to comment Share on other sites More sharing options...
j8snl Posted March 8, 2015 Author Share Posted March 8, 2015 OK thanks for that, but I think I'd figured that out, I'm trying to establish why? I've enclosed a screenshop from cpanel showing the database name and the username, so that only leaves the password which I know is correct. And here's the settings.inc.php file <?php define('_DB_SERVER_', 'localhost'); define('_DB_NAME_', 'bagpipe_prestanew'); define('_DB_USER_', 'bagpipe_psdata'); define('_DB_PASSWD_', 'xxxxxxxxxx'); define('_DB_PREFIX_', 'ps_'); define('_MYSQL_ENGINE_', 'MyISAM'); define('__PS_BASE_URI__', '/'); define('_PS_CACHING_SYSTEM_', 'CacheMemcache'); define('_PS_CACHE_ENABLED_', '0'); define('_MEDIA_SERVER_1_', ''); define('_MEDIA_SERVER_2_', ''); define('_MEDIA_SERVER_3_', ''); define('_COOKIE_KEY_', 'sxgbCRDzoDE9MNI1aikv2ICjaPgy5K2xss6YHvvBCMbAznzIIRdhNj4z'); define('_COOKIE_IV_', 'IR6KiouP'); define('_PS_CREATION_DATE_', '2014-01-30'); define('_PS_VERSION_', '1.5.6.2'); define('_PS_DIRECTORY_', '/'); ?> So, can you see any reason why I'm having a connection problem that I'm not seeing, does this settings file look correct?, is there something missing that's not obvious to someone who'd never seen Prestashop before this morning? Thanks Jason Link to comment Share on other sites More sharing options...
j8snl Posted March 8, 2015 Author Share Posted March 8, 2015 @COTOKO A quick php script validates that my connection is good: <?php mysql_connect('localhost', 'bagpipe_psdata', 'xxxxxxxxxx') or die('Could not connect the database : Username or password incorrect'); mysql_select_db('bagpipe_prestanew') or die ('No database found'); echo 'Database Connected successfully'; ?> Call that script and I see Database Connected successfully on screen. So, is there something I'm missing in the settings file, or that's perhaps been removed before we got it? Thanks again Jason Link to comment Share on other sites More sharing options...
j8snl Posted March 8, 2015 Author Share Posted March 8, 2015 (edited) So, I found the PS_MODE_DEV option and set that to true which expands on the issue: Warning: PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password] in /home/bagpipe/public_html/classes/db/DbPDO.php on line 44Link to database cannot be established: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client Server is running PHP 5.4.35 and I can only now assume that's creating some issue with MySQL and the password with an older format. Edited March 8, 2015 by j8snl (see edit history) Link to comment Share on other sites More sharing options...
Rolige Posted March 8, 2015 Share Posted March 8, 2015 settings.inc.php file looks fine, check the file permissions in the ftp, should be...Files: 0644Folders: 0755Also, enable debug mode, always is a good practice before put in production. Link to comment Share on other sites More sharing options...
HillcrestHS Posted March 13, 2015 Share Posted March 13, 2015 j8snl - Are you still having these issues... I've just gone through 2 days of trying to get this done (in a slightly different) way so may be able to help Link to comment Share on other sites More sharing options...
j8snl Posted March 13, 2015 Author Share Posted March 13, 2015 Hi there, so I can confirm I got this working. Basically the previous config was using a 40byte password in the MySQL, my host where it was moved to was using 16byte causing the issue. I didn't have access to use oldpassword=1 on the MySQL and then set the password again, but I did raise a support ticket with my hosting company and they done it. I'm currently now transferring the domain names over but yes, all working. Thanks for the response, and hope this helps someone else. Jason Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now