Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Mysql Port Rate Topic   - - - - -

 
  • shervain
  • Junior Member
  • Members
  • Join Date: 22-Aug 10
  • 13 posts

Posted 27 August 2014 - 01:43 AM #1

Does anyone know how I can configure CS-Cart to access our database on a different port?

I have tried using "localhost:XXXX" but this does not work and we still get an error connecting to database

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19774 posts

Posted 27 August 2014 - 08:17 AM #2

Does anyone know how I can configure CS-Cart to access our database on a different port?

I have tried using "localhost:XXXX" but this does not work and we still get an error connecting to database


We found the following code in the app/Tygh/Backend/Database/Mysqli.php file:

@list($host, $port) = explode(':', $host);
$this->_conn = @ new \mysqli($host, $user, $passwd, $database, $port);

So your solution should work

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11390 posts

Posted 27 August 2014 - 09:46 PM #3

Just curious, why have a non-standard port for 'localhost'? mySQL should never be publicly exposed on any port for an ecommerce site.
You might be able to use a .my_conf file to the home directory of the user PHP runs as so that when mysql is invoked that it will use that configuration setting. But this could be server/host dependent due to security issues.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.