hyungjay Posted April 23, 2018 Share Posted April 23, 2018 Hi, Previous programmer defined the MySQL Server name on MySQL directly, not thru configuration.php file, How can I find where he assigned MySQL Server directly on the MySQL server? Could you please anyone let me know how to do it? my site is http://www.fashionpointinc.com/ Please advise, if anyone can fix it for me, please send me a quote. Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 23, 2018 Share Posted April 23, 2018 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 More sharing options...
ArtcoInc Posted April 23, 2018 Share Posted April 23, 2018 @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 More sharing options...
ArtcoInc Posted April 23, 2018 Share Posted April 23, 2018 @wHiTeHaT That's a possibility too ... @hyungjay Which version of osCommerce is your store? Link to comment Share on other sites More sharing options...
hyungjay Posted April 23, 2018 Author Share Posted April 23, 2018 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 20Unable to connect to database server!" How can I fix that, it is really hard to find out Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 23, 2018 Share Posted April 23, 2018 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 More sharing options...
hyungjay Posted April 23, 2018 Author Share Posted April 23, 2018 I already changed the MySQL Server information. Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 24, 2018 Share Posted April 24, 2018 I think you need to explain in detail what the problem is since all that is being done is guessing at what you want. 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 More sharing options...
hyungjay Posted April 24, 2018 Author Share Posted April 24, 2018 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 More sharing options...
Jack_mcs Posted April 24, 2018 Share Posted April 24, 2018 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 More sharing options...
MrPhil Posted April 24, 2018 Share Posted April 24, 2018 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 More sharing options...
olidev Posted April 30, 2018 Share Posted April 30, 2018 Apart from that w3school guide, you can also follow this tutorial on how to connect mysql database with php to fix your issue. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.