Jump to content

Unable to access 'Shop'


Big Gee

Recommended Posts

Hi everyone.

Still haven't sorted out the payment gateway problem using Stripe. They keep on saying that it's a problem for Cube Cart.

Anyway, this is a totally new problem. Someone else that I installed Cube Cart for has contacted me, saying he can't get into the front or back-end of his site.

Here's the error message that's thrown up:

 

Quote

Warning: mysqli::__construct(): (28000/1045): Access denied for user 'scc123_sccAdmi'@'localhost' (using password: YES) in /home4/scc123/public_html/pangothica.co.uk/classes/db/mysqli.class.php on line 33

Warning: mysqli_options(): Couldn't fetch mysqli in /home4/scc123/public_html/pangothica.co.uk/classes/db/mysqli.class.php on line 35

Fatal error: Access denied for user 'scc123_sccAdmi'@'localhost' (using password: YES) in /home4/scc123/public_html/pangothica.co.uk/classes/db/mysqli.class.php on line 38

Any pointers as to what the problem may be? And how I should go about tackling it? I'm very confused with this bit "(using password: YES)" - where did that come from? I have no record of using a password called "YES". Also on looking at classes/db/mysqli.class.php on line 33 - there is no coding on that line!

A bit confused and need a helping hand to point me in the right direction please.

Thanks,

G.

Link to comment
Share on other sites

Maybe in the package you are looking at, but in my package of CC6112, line 33 is:

$this->_db_connect_id = new mysqli($config['dbhost'], $config['dbusername'], $config['dbpassword'], $config['dbdatabase'], $dbport, $dbsocket);

Access denied means that the database server is expecting connects via 'localhost' for the user named 'scc123_sccAdmi'. The "using password: YES" bit is announcing the fact that the connect did not forget to have included a password. That is, 'yes, a password was sent". That password may be wrong, but it was included in the connection attempt.

So, either the username is wrong, the password is wrong, the means to connect is wrong (that is, maybe need to use an actual web address for a database server not on the same server as the web site - as opposed to 'localhost'), or the user has not been given permission to access the named database.

Compare the contents of /includes/global.inc.php with what the log on credentials are stated to be in the hosting account's control panel, MySQL Database details.

Edited by bsmither
Link to comment
Share on other sites

Thanks Brian,

But the site was working fine, until the site owner encountered this problem out of the blue. The error message is the same whether you try to access the shop front using the URL address, or try to log into the admin dashboard.

That file on my server has

"* MySQLi database controller" on line 33.

I've attached a copy of the whole file for you to look at.

All the best,

G.

mysqli.class

Link to comment
Share on other sites

"The error message is the same whether you try to access the shop front using the URL address, or try to log into the admin dashboard."

Both use the same database.

Looking at the attached file (using UltraEdit), line 33 is exactly as I posted above. I need to question the programmer's text editor you are using to view the file. What you say is on line 33 (" * MySQLi database controller") is line 17 in the file. Using the file you attached to the post, here is what I see:

<?php
/**
 * CubeCart v6
 * ========================================
 * CubeCart is a registered trade mark of CubeCart Limited
 * Copyright CubeCart Limited 2015. All rights reserved.
 * UK Private Limited Company No. 5323904
 * ========================================
 * Web:   http://www.cubecart.com
 * Email:  [email protected]
 * License:  GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
 */
if (!defined('CC_INI_SET')) die('Access Denied');
require CC_ROOT_DIR.'/classes/db/database.class.php';

/**
 * MySQLi database controller
 *
 * @author Technocrat
 * @author Al Brookbanks
 * @since 5.0.0
 */
class Database extends Database_Contoller {

	##############################################

	final protected function __construct($config) {
		$this->_db_engine = 'MySQLi';

		$dbport = (isset($config['dbport']) && !empty($config['dbport'])) ? $config['dbport'] : ini_get('mysqli.default_port');
		$dbsocket = (isset($config['dbsocket']) && !empty($config['dbsocket'])) ? $config['dbsocket'] : ini_get('mysqli.default_socket');

		$this->_db_connect_id = new mysqli($config['dbhost'], $config['dbusername'], $config['dbpassword'], $config['dbdatabase'], $dbport, $dbsocket);

Now, if for every line there is an extra linefeed, then line 17 would change to line 33. Seeing double-spaced lines is an artifact of the editor you are using. Some editors can correct the display when having corrupted line endings, and show the code single-spaced.

Now, as to the file, it seems somewhere along the way, an edit (or FTP upload with automatic line ending correction) has corrupted the line endings:

00000000h: 3C 3F 70 68 70 0D 0D 0A 2F 2A 2A 0D 0D 0A 20 2A ; <?php.../**... *

Note that there is 0D which is a line ending used by Macs (pre-OSX), then 0D 0A which is a line ending used by DOS. Unix-type operating systems use just 0A for a line ending.

None of this explains the difficulty connecting to the database.

 

If this problem happened "out of the blue", then we need to blame the hosting provider and ask them what has recently changed regarding the hosted environment.

Link to comment
Share on other sites

Thanks Brian,

That makes sense i.e. it may be something at the heart of the hosting environment that has changed. The hosting company is Hostgator.

The text editor I use is Notepad++

Do you think that if I FTPd the original 'mysqli.class.php' file back to the directory on the server - thereby overwriting the corrupt version on there -  that it could resolve this problem?

Take care,

G.

Link to comment
Share on other sites

Looks like a case of scrubbing everything and starting from scratch. Can't 'repair' the database tables either, because the server uses an InnoDB  storage engine . I think I'm chasing my tail here, and wasting valuable time. Fresh load of CC - delete the DB & start again I think is the best option - it looks like a horrible one. I'm giving up on it - unless someone comes up with some ideas.

Cheers,

G.

   
Link to comment
Share on other sites

Compare the contents of /includes/global.inc.php with what the log on credentials are stated to be in the hosting account's control panel, MySQL Database details.

Access denied is happening even before getting to the tables. So, there is no need to try to repair the tables. And, true, InnoDB does not get repaired. I think they don't ever have that problem.

CubeCart several versions back switched to having most (not all) tables go with InnoDB for performance reasons.

Link to comment
Share on other sites

Ah - that's a relief, I was doubting whether it was a DB problem. From what you say Brian, it couldn't be the database.

I checked ' /includes/global.inc.php' and everything there seems to match up to the DB details. The strange thing is that this just happened suddenly - everything was working fine before.

I still get this error message when I try to enter the shop front. Can't get into the Admin dashboard either.

 

Quote

Warning: mysqli::__construct(): (28000/1045): Access denied for user 'scc123_sccAdmi'@'localhost' (using password: YES) in /home4/scc123/public_html/pangothica.co.uk/classes/db/mysqli.class.php on line 33

Warning: mysqli_options(): Couldn't fetch mysqli in /home4/scc123/public_html/pangothica.co.uk/classes/db/mysqli.class.php on line 35

Fatal error: Access denied for user 'scc123_sccAdmi'@'localhost' (using password: YES) in /home4/scc123/public_html/pangothica.co.uk/classes/db/mysqli.class.php on line 38

One thing I will try, is to delete the index.html file that's in the same directory as the index.php file. Although that's  hasn't been a problem in the past, I wonder if there's a glitch there somewhere?

Thanks Brian,

G.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...