Post by oc_ology » Tue Mar 08, 2016 10:44 am

Im gettting these 3 erros when installing for the first time. Firstly, i should explain im installing on my local development machine on local host not on a production server. Ive done this in the past with other CMS's Wordpress, Joomla etc ... with no problems. My version of OC is OpenCart 2.1.0.2 and the 3 erros appearing after completing the database configuration during install - error line are thus (with personal paths removed for privacy) :
Warning: mysqli::mysqli() [mysqli.mysqli.chm]: (28000/1045): Access denied for user 'mydbusrname'@'localhost' (using password: YES) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mypath\mysitename\system\library\db\mysqli.php on line 7
Notice: Error: Could not make a database link (1045) Access denied for user 'mydbusrname'@'localhost' (using password: YES) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mypath\mysitename\system\library\db\mysqli.php on line 10
Warning: mysqli::close() [mysqli.close.chm]: Couldn't fetch mysqli in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mypath\mysitename\system\library\db\mysqli.php on line 58
The problems are obviously with the mysqli script in the system/db directory but ive no idea what.

I have no problems using mysqli on this machine ive been using it for years with no problems.

Ive tried stating both the mysqli and mPDO extensions one after the othe and leaving the prefix set to oc_ but nothing seems to get past this issue - anyone else experience this???

thanx

Newbie

Posts

Joined
Tue Sep 18, 2012 12:52 am

Post by RomanD » Tue Mar 08, 2016 2:34 pm

I had same issue on linux, then I changed password for database and it works. Maybe my first password contains some not supported characters?

User avatar
Newbie

Posts

Joined
Fri Apr 11, 2014 8:14 pm

Post by Randem » Tue Mar 08, 2016 3:33 pm

Hi oc_ology,

You may get such errors on a new install just after you create you new database for the database name does not get int DNS and therefore cannot be found by its name and you would have to use the databases IP address until the name finds its way into DNS. This could take up to 24 hours in some cases but It can happen in as little as a few minutes...

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by RomanD » Tue Mar 08, 2016 10:28 pm

Randem wrote:Hi oc_ology,

You may get such errors on a new install just after you create you new database for the database name does not get int DNS and therefore cannot be found by its name and you would have to use the databases IP address until the name finds its way into DNS. This could take up to 24 hours in some cases but It can happen in as little as a few minutes...
check his logs, he is using "localhost", how you can miss that?

User avatar
Newbie

Posts

Joined
Fri Apr 11, 2014 8:14 pm

Post by oc_ology » Tue Mar 08, 2016 11:46 pm

Hi all,

thanks for the suggestions - with some experimentation i found the answer so ill post it for others facing the same issue.
You MUST use Alphanumerics only for database name and username. I changed both and it worked instantly and i completed the remaining install process without problems.

However, this is worrying and im not entirely happy with this because you SHOULD be able to use certain characters in DB names and usernames. I initially used underscores in both to emulate what happens on most shared hosts were your username is prefixed to both with an underscore character. If this solution is correct then when we go live (shared hosting) and our username is prefixed to the db_username and database name will we face the same issue again???

Im no noob and this is really strange behaviour since mySQLi has no problem with DB names usually! Internally the system will escape underscores with a usual backslash (just view your db names in your GUI of choice like PHPMyAdmin) and you'll see underscrores are escaped.

I going to look at the OC script mysqli.php which i believe has a bug.

Cheers all for now ...

Newbie

Posts

Joined
Tue Sep 18, 2012 12:52 am

Post by Randem » Wed Mar 09, 2016 4:23 am

That is not a bug, Check your host for database name acceptance since that is where you create the database. Unless you are saying you created the database with special characters in the name and OpenCart would not accept it. In this case it is still not a bug. If OpenCart chooses to not accept special characters for what ever reason it is their choice... You can however choose to change the code to accept special characters but without know exactly why it was chosen NOT to use special characters you may be setting yourself up for some headaches.

I can see how some special characters and php would not get along together and that could be the whole reason for not allowing special characters...

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by RomanD » Wed Mar 09, 2016 8:04 am

I had database name and username alphanumerics only, and still I had this error. So also your password can not contain some special characters.

User avatar
Newbie

Posts

Joined
Fri Apr 11, 2014 8:14 pm

Post by oc_ology » Thu Mar 10, 2016 8:39 pm

hi, @Randem, RomanD,

Not true the underscore character is one of the few characters that IS allowed where alphanumerics are required. Its the acceptable way to concatenate strings the bug is in OpenCarts' mysqli.php propbably the version i'm using. There's nothing in my local installation of Apache, mySQLi, PHP to indicate that the underscore is problematic - i use it all the time in my naming convention.

OpenCarts' mysqli.php script has created the limitation since the workaround was to remove the (offending) underscore character - i suspect its the character set that been defined during the install process or phpMyAdmin. We have to remember that the underscore along with the '%' char is a 'WildCard' character.

As for the password comment (RomanD) - all characters are acceptable in passwords since the password SHOULD be encrypted. Any professional system should encourage creating passwords which use alpha numerics, both upper/lowercase AND punctuation characters.

Newbie

Posts

Joined
Tue Sep 18, 2012 12:52 am
Who is online

Users browsing this forum: No registered users and 8 guests