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
but i already use the correct database server/username and password.What should i do help me
thank you
I dont not. my database ip is different from my domain ip. in phpmyadmin you can see your database ip.
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
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
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.
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.
Thank you, you helped me a lot.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
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.
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.
To resolve, edit /etc/php.ini and replace all occurrences of /var/mysql/mysql.sock with /tmp/mysql.sock.
Thank you!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
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.
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.
Solution
1. Click on 'Check Privileges' for your databse
2. Click on 'add user'
3. Enter username, password and other privileges..
4. Submit
Go back to installation..
Enter user name and db details... Done

1. Click on 'Check Privileges' for your databse
2. Click on 'add user'
3. Enter username, password and other privileges..
4. Submit
Go back to installation..
Enter user name and db details... Done

Best Regards,
Rinu Thomas
Solution
1. Click on 'Check Privileges' for your databse
2. Click on 'add user'
3. Enter username, password and other privileges..
4. Submit
Go back to installation..
Enter user name and db details... Done

1. Click on 'Check Privileges' for your databse
2. Click on 'add user'
3. Enter username, password and other privileges..
4. Submit
Go back to installation..
Enter user name and db details... Done

Best Regards,
Rinu Thomas
Hello rinuthomas90,
Just wanted to see if you got this issue resolved or not. If you haven't, just to summarize, your database server is different from your web hosting server, right? If it were within the same server, then the setting would be "localhost", but if you're on a different server, you need to make sure to properly identify the IP of the database server and use it for the server settings. If you know the URL to your database server, you can simply go to a command line or shell and ping it and you'll see the IP.
Also, you might need to specify the port (an earlier post indicated where to edit that info). Though you may need to consult with your host for ports getting into your database server. The default port for the MySQL server is typically 3306. For our hosting service, we also require a policy to be written to allow entry through the firewall (for remote connections).
Hopefully, though, you already have the issue solved. Let us know if you're still having problems and if so, then we'll try our best to help.
Happy Holidays!
Arnelzhub
http://www.webhostinghub.com
Just wanted to see if you got this issue resolved or not. If you haven't, just to summarize, your database server is different from your web hosting server, right? If it were within the same server, then the setting would be "localhost", but if you're on a different server, you need to make sure to properly identify the IP of the database server and use it for the server settings. If you know the URL to your database server, you can simply go to a command line or shell and ping it and you'll see the IP.
Also, you might need to specify the port (an earlier post indicated where to edit that info). Though you may need to consult with your host for ports getting into your database server. The default port for the MySQL server is typically 3306. For our hosting service, we also require a policy to be written to allow entry through the firewall (for remote connections).
Hopefully, though, you already have the issue solved. Let us know if you're still having problems and if so, then we'll try our best to help.
Happy Holidays!
Arnelzhub
http://www.webhostinghub.com
Here's the solution for cases when changing MySQL password is not an option:
Open /install/controller/step_3.php and change (line 218):
to this
where PASSWORD is of course to be replaced by your crazy non-standard password.
Now open /install/model/install.php and change (line 4):
to this
again, replace PASSWORD by your MySQL password.
Now do the step 3 again - refreshing it will probably do the trick.
Installation should now finish and you are invited to visit your online shop or administration. Not so fast!
Open both /config.php and /admin/config.php. Passwords in both files probably look something like this:
Some special characters like & or < got converted into their HTML-safe counterparts. Replace those mutant passwords in both files with the real ones.
Don't forget to delete /install directory!
Now have a beer.
Open /install/controller/step_3.php and change (line 218):
Code: Select all
if (!$connection = @mysql_connect($this->request->post['db_host'], $this->request->post['db_user'], $this->request->post['db_password'])) {
Code: Select all
if (!$connection = @mysql_connect($this->request->post['db_host'], $this->request->post['db_user'], 'PASSWORD')) {
Now open /install/model/install.php and change (line 4):
Code: Select all
$db = new DB('mysql', $data['db_host'], $data['db_user'], $data['db_password'], $data['db_name']);
Code: Select all
$db = new DB('mysql', $data['db_host'], $data['db_user'], 'PASSWORD', $data['db_name']);
Now do the step 3 again - refreshing it will probably do the trick.
Installation should now finish and you are invited to visit your online shop or administration. Not so fast!
Open both /config.php and /admin/config.php. Passwords in both files probably look something like this:
Code: Select all
define('DB_PASSWORD', 'my<crazypassword&');
Don't forget to delete /install directory!
Now have a beer.
Your hosts will in the control panels under Databases show the critical settings for each database. The addressing must match that in server lingo; externally accessible addresses aren't that lingo. The naming of databases follows each server's own syntax and relates to account usernames on that server. For passwords use ordinary keyboard letters and numbers, no language-specific characters, and no punctuation marks, unless your server documents doing otherwise (as it probably would in some of the alphabetically different areas of the world). For user the special one named "root" is not a good choice for security reasons on a production box.
Ensure that BOTH config.php files, in their sections for http, https, directories, and database, conform EXACTLY to the present server. A common oversight springs from tiny typrogripigal errots that weren't proofread enough times.
Ensure that BOTH config.php files, in their sections for http, https, directories, and database, conform EXACTLY to the present server. A common oversight springs from tiny typrogripigal errots that weren't proofread enough times.
Who is online
Users browsing this forum: No registered users and 10 guests