Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

define MySQL Server on MySQL DB


hyungjay

Recommended Posts

Assuming you are referring to the database, you can find some of what you need in hosts control panel. The password can't be retrieved so you might need to create a new one. Your host should be able to provide a better answer if this doesn't help.

Or, if just want to see what it is currently set to, look in the includes/configure.php file.

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@hyungjay

If you are saying that a previous programmer hard coded the Server Name into your store's code (instead of using the stock call to configuration.php), then you need to look in the file /catalog/includes/functions/database.php ... around line 20. (although, I do not know why someone would do that)

If that is not what you are saying, please restate your question. Or, you can ask for a bid in the commercial section of this forum:

https://www.oscommerce.com/forums/forum/79-commercial-support-inquiries/

Link to comment
Share on other sites

database.php shows " $$link = mysqli_connect($server, $username, $password, $database);"

however the site is still looking for old MySQL Server information, 

I upgraded to 2.3.41 from 2.2.1MC and some reason the site is keep trying to connect to old hosting MySQL server instead local host.

Checked the application_top.php but nothing in there.

when I ran "select @@hostname" on phpadmin, it shows old MySQL Hosting server name, so I wonder if the guy hard code in MySQL.

 

I am getting "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/06/3411506/html/includes/functions/database.php on line 20
Unable to connect to database server!"

 

How can I fix that, it is really hard to find out

Link to comment
Share on other sites

You will need to change the settings in includes/configure.php so that it uses the new database, that you will have to create.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I have migrated the server from old linux to new linux per godaddy's suggestion and the MySQL server was not on localhost previously, the programmer configured the osc v2.2.1MC (I think), so I upgraded it to latest version of OSC, also ran the upgrade SQL file.

I changed the configure.php files on two different location however some reason OSC is keep looking for old MySQL Server instead localhost at all.

"Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/06/3411506/html/includes/functions/database.php on line 20 Unable to connect to database server!"

I looked the database.php and application_top.php but does not define the previous MySQL settings at all.

So I query the "select @@hostname" that brings up the old server name, I'd like to find out if previous programmer hard coded the server name in MySQL database and if anyone knows how to do it?

Link to comment
Share on other sites

If he hard-coded it, there's no way for anyone here to tell you how to find it since that is something unique to your shop. I suggest you create a test file that connects to the database. Don't have anything in the file except for the commands to access it. Here's an example if you don't know how to do that. If that fails, it means your shop is not the problem for the connection. Once you have that script working, copy those settings to the configure files and you should be all set. Or, at least, you would have eliminated one possible cause.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Your programmer should have only touched the two configure.php files -- if he "hard coded" DB information in the code, where it's used, he's incompetent. If I understand your explanation, in your old server you had the DB server name as something like an IP address or a name "mysql259.myhost.com", and on your new server the DB server is "localhost"? Back out whatever changes your programmer made, and update the two configure.php files to use "localhost" for the DB server name. That should do it.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...