Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Mysql con. failed.../var/lib/mysql/mysql.sock


spofster

Recommended Posts

Posted

I have a rather strange problem..i have been running the shopping cart on my local win pc and i have had no probelms..But now that i have moved it to a linux box to try test it, i get the error below..

 

:!: Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/pp/catalog/includes/functions/database.php on line 19

Unable to connect to database server! :!:

 

I have no idea as to what i should do..

 

Could someone pls help me out..

 

Thanx :!:

Posted

If you have shell access to host - run mysql client and type

status; (and press enter :) )

This show you some mysql related information, including socket name. If this name not

/var/lib/mysql/mysql.sock

then you need edit your php.ini file.

There is always more than one way to do it.

And always Keep It Simple, Stupid.

Posted

This site was operating fine, and I am not sure what happened. I cannot log into the admin now:

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'shelldav_oscom0@localhost' (Using password: YES) in /home/shelldav/wwwroot/shelldave.com/ecommerce/catalog/includes/functions/database.php on line 19

Unable to connect to database server!

 

Please help!

Jenn

Posted

Jenn, it sounds like you need to supply the correct login credentials for the database. In catalog/includes/configure.php, make sure you have the following defined properly:

define('DB_SERVER_USERNAME', 'VALID_USERNAME');

define('DB_SERVER_PASSWORD', 'VALID_PASSWORD');

 

Also, make sure that the credentials you supply still exist on the MySql server and have access to the database to which you are trying to connect.

Posted

I gave everything new passwords to make sure matching, I can get into catalog, but admin still gives me that error code.

:?

Posted

Hrmm... Looking at that more closely, there are a few things amiss. To reach your admin section, I think OSC should be using the database.php in admin/includes/functions.

 

Also I forgot to mention that you also need to set some stuff up in the admin/includes/configure.php

  define('DB_SERVER', 'SERVERIP'); // eg, localhost - should not be NULL for productive servers

 define('DB_SERVER_USERNAME', 'VALIDNAME');

 define('DB_SERVER_PASSWORD', 'VALIDPASS');

 define('DB_DATABASE', 'VALIDDBNAME');

 define('USE_PCONNECT', 'true'); // use persisstent connections?

 

Also you said that you moved the site from a windows box to a Linux box... Does that include moving the database as well? If so you'll want to change the DBSERVER definition in both the admin and the catalog configure.php files.

 

Hope that helps[/code]

  • 5 weeks later...
Posted

This had been working ok, now I am working on adding the option type product attributes contribution and I'm getting an error.

 

I can log in to the database fine, but when I try to run the MySQL file, it says,

MySQL said: 





Access denied for user: 'shelldav_oscom0@localhost' to database 'shelldav_oscom0'

 

I just went through the files checking on root directories, db names, server names, user names and passwords. Can anyone tell me what is up?

Jenn :cry:

Posted

This may be a stupid question, but does your MySql account have the proper authority to make the changes you are trying to implement?

Posted

Obviously not a stupid question because I am not sure exactly what you mean? Pretty new at the database stuff, I did CHMOD the admin files and anything I thought was related to 777, with no change.

 

How do I check "authority to make changes"?

 

:roll:

Jenn

Posted

What are you using to administer your database server? Are you using PhpMyAdmin, or Webmin, or just the command prompt? You should be able to selectively grant any of the following permissions to a MySql user account:

 

Select table data

Insert table data

Update table data

Delete table data

Create tables

Drop tables

Reload grants

Shutdown database

Manage processes

File operations

Grant privileges

Reference operations

Manage indexes

Alter tables

Posted

using phpmyadmin

still working on it

got codes from mysql site about fixing error code, no results so far

:cry:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...