ClaireWalters Posted February 4, 2016 Share Posted February 4, 2016 Hello! I been trying to install a clean copy of the newest ver6 on a 1and1 server. I keep getting this error message Incorrect database host, username, and/or password. here's the info provided from my server when I setup the database. I copy & pasted the info into the install screen. Any suggestions? Thank you! Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 4, 2016 Share Posted February 4, 2016 For the Hostname, please enter simply localhost. For the database name, simply the sequence that starts with d. For Username, simply the sequence that starts with d. And you have your password. Now, please edit the post above to remove the access credentials. The world does not need to see those. Quote Link to comment Share on other sites More sharing options...
ClaireWalters Posted February 4, 2016 Author Share Posted February 4, 2016 9 minutes ago, bsmither said: For the Hostname, please enter simply localhost. For the database name, simply the sequence that starts with d. For Username, simply the sequence that starts with d. And you have your password. Now, please edit the post above to remove the access credentials. The world does not need to see those. I've done it several times and keep getting the same error message I even changed the password to the database to make sure I was typing it correct Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 4, 2016 Share Posted February 4, 2016 When you access your hosting control panel (Cpanel?), you have a tool called phpMyAdmin. Your Cpanel is set up so that phpMyAdmin has the correct access credentials. Poke around phpMyAdmin's front screen (not looking at any specific database) and see if there is a panel that shows how phpMyAdmin is connecting. From a search at a Wordpress Help site: "1&1 do not use localhost, but rather 'dbXXXXX.db.1and1.com'." Your host domain may be different. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted February 5, 2016 Share Posted February 5, 2016 12 hours ago, bsmither said: From a search at a Wordpress Help site: "1&1 do not use localhost, but rather 'dbXXXXX.db.1and1.com'." Your host domain may be different. That is correct - 1and1 use dedicated MySQL servers so localhost will never work for them and you should use the credentials provided. This is not however a CubeCart issue and you should contact 1and1 support for help as (assuming the have entered them all correctly - which as Brian said, can be tested by going through their hosting control panel and checking access with phpMyAdmin) then there is a communication / configuration issue between the two different servers. We have migrated a lot of CubrCart users away from 1and1, over the years for various issues, and if you ever move your store be aware that many (but not all) of their MySQL servers are running Windows (which always seems a strange combination to me !) and this causes problems with database and table naming. Ian Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 5, 2016 Share Posted February 5, 2016 The OP and I have been working via PM and I think there is a solution to this issue. The database access credentials given by the control panel assume that the application will be using the mysql() function family. Compare that to the mysqli() function family. The order and type of parameters for connecting to a database are different between the two families. CubeCart's setup will first attempt to use the mysqli() function to connect. It will fail because the provided parameters for this particular server environment are not correct for mysqli(). I gave the OP an edit to test and we will have the results shortly. If it works, I will post an issue in the Github. Quote Link to comment Share on other sites More sharing options...
havenswift-hosting Posted February 5, 2016 Share Posted February 5, 2016 Hi Brian You obviously have more detailed information regarding the scenario and I will be interested to hear the outcome of your investigtion and tests, but a workaround for the MySQL extension which was deprecated in PHP 5.5.0 and was fully removed in PHP 7.0.0, doesn't seem the correct way forward, if that is what you are looking at ? Ian Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 5, 2016 Share Posted February 5, 2016 A workaround? No, but CubeCart will eventually need to drop the mysql() API once PHP 7 is at sufficient deployment. This is more like accommodating a server environment -- how common of an environment, I have no way of knowing. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 5, 2016 Share Posted February 5, 2016 You may understand this server environment - I don't. 1&1 is giving the OP this as host: localhost:/tmp/mysql5.sock The mysqli API cannot use the multi-part value - it must have host, then a separate parameter for the port, then a separate parameter for the socket. As opposed to the mysql API where host can have all that separated by colons. The code I suggested is in /setup/setup.install.php, near line 89. Replace: $mysql_connect = false; // Connection Check - Update for mysqli if (function_exists('mysqli_connect')) { $connect = mysqli_connect($_POST['global']['dbhost'], $_POST['global']['dbusername'], $_POST['global']['dbpassword'], $_POST['global']['dbdatabase']); With: $mysql_connect = false; // Connection Check - Update for mysqli if (function_exists('mysqli_connect')) { $_POST['global']['dbhost_socket'] = explode(':',$_POST['global']['dbhost']); // Break apart for some servers $connect = mysqli_connect( $_POST['global']['dbhost_socket'][0], $_POST['global']['dbusername'], $_POST['global']['dbpassword'], $_POST['global']['dbdatabase'], null, (!empty($_POST['global']['dbhost_socket'][1])?$_POST['global']['dbhost_socket'][1]:null) ); However, the OP just reported that this caused a 500ISE. So, maybe something about the above code isn't quite right just yet. Perhaps making sure the database class (and perhaps globals.inc.php) have distinct parameters for the mysqli::__construct method. There are better ways -- undoubtedly some default values can be written into the PHP.INI file for the [mysqli] block. The OP reports that 1&1 is suggesting the application forego using mysqli and rely exclusively on mysql. Quote Link to comment Share on other sites More sharing options...
ClaireWalters Posted February 6, 2016 Author Share Posted February 6, 2016 The solution to this was to add this line to the ini.inc.php file ini_set('mysqli.default_socket', '/tmp/mysql5.sock'); // Needed for 1&1 managed servers I can't thank Bsmither enough for all his help! edit to add: I'm using a managed dedicated server. I'm sure this fix will work with shared servers as well. unmanaged dedicated servers at 1and1 - admins should be able to change the settings on the servers without needing this edit. When I ran the CC v6 setup. I entered localhost in the field where it asked for hostname. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.