Could not connect to database Opencart

Please LogIn to Reply!

Post By: guest | 01-22-2013 07:57 Reply

Question

i got problem when put database host and user...its shows Error: Could not connect to the database please make sure the database server, username and password is correct!

but i already use the correct database server/username and password.What should i do help me

thank you

Answers

write database ip adress to the database host
without http or www only the ip number

already try but same problem.on database host i put the ip number of my domain.is it right?

I dont not. my database ip is different from my domain ip. in phpmyadmin you can see your database ip.

can u show me step by step where can i find a database host ip?

thank you

Hello,

I'm also new to Opencart.
On instalation I had the same problem, Opencart doesn't support symbols as password, you surely generated the database password, juste generate a new using only letter and number, with the same security level.

solution: change your database password

That really irritated me, that needs to be stated in the install txt. That your database password cannot contain any symbols and thats really lame that you cant have that security. >:(

I'm experiencing the same phenomenon;
After successfully installing it on my Windows box, I tried installing on my Xandros Linux notebook, but failed in step 2 of the installation; "could not connect to the DB". double & triple checked the user name & password - all is fine. Not using any special characters in my user/password/database .
When I remove the password (wether the specific user needs one or not, the message I get back is "Database does not exist!").
(Database does exist...)
I'm at lost.
TIA

I figured it out...
The user I was using did not have the right privileges (not sure why; maybe something wrong the way PMA creates users), and could not see the selected database.
I created a new user (manually), gave him the correct privileges, and installed the cart successfully.

FraZeks wrote:Hello,

I'm also new to Opencart.
On instalation I had the same problem, Opencart doesn't support symbols as password, you surely generated the database password, juste generate a new using only letter and number, with the same security level.

solution: change your database password


Thank you, you helped me a lot.

I've searched through the forums for all topics related to "Could not connect to database", and still haven't solved this issue. I wonder why the solution to this isn't within the install.txt file?

What I have now....

Database Host: localhost
*User: prefixed user from "Current Databases" section of cPanel
Password: blank
*Database Name: prefixed database from "Current Databases" section of cPanel
Database Prefix: blank

*Username: same as above, with or without the prefix it doesn't seem to matter
*Password: pw I assigned when I created the user in cPanel

Note the user IS added to the database. I'm on shared hosting. I tried entering my dedicated IP address for "database host" but that didn't work either. Same with entering my website URL. There are no symbols within my password.

Very frustrating first experience with OpenCart. I hope someone can provide some guidance.

I had the very same problem and just figured it out. By default, PHP looks in /var/mysql/mysql.sock for the socket to connect to MySQL on. Some MySQL installs, such as on OS X in my case, put the sock in /tmp/mysql.sock.

To resolve, edit /etc/php.ini and replace all occurrences of /var/mysql/mysql.sock with /tmp/mysql.sock.

FraZeks wrote:Hello,

I'm also new to Opencart.
On instalation I had the same problem, Opencart doesn't support symbols as password, you surely generated the database password, juste generate a new using only letter and number, with the same security level.

solution: change your database password


Thank you!

Just bumping this with some additional info. I just had to reinstall to a new server and had the same "Cannot Connect" error. Changed password to alpha-numerics didn't work. Additionally it's not always possible to remove the "_" (underscore) from db names because that appears to be something dependent on the host (not a user set-able value).

Turns out, for me at least, the database that Opencart wants to use has to be completely 'clean'. So try setting up a brand new database with a username of choice and alpha-numeric password (no 'special' characters), see if that helps with these stubborn instances during installation.

Tags:

opencart error: database does not exist!

Reply Or Comment!
Please LogIn to Reply!