How to install SugarCRM 5.0 on MySQL with non-standard port?
Hello forum,
i was very successful installing SugarCRM 4.5.1 on a linux server with mysql on non-standard ports (NOT 3306) using configurations like e.g. "127.0.0.1:3321" for the database host.
BUT, when i was trying the same thing for SugarCRM 5.0.0, the installation could not complete because no connection to the database server could be established.
So, now here is my question: is it generally possible to install SugarCRM on a database with another port than 3306? And if, how?
Thank you very much for your support.
Best regards,
Benny
Re: How to install SugarCRM 5.0 on MySQL with non-standard port?
PHP Code:
db_host_name='localhost:12345'
Should do the trick?
Re: How to install SugarCRM 5.0 on MySQL with non-standard port?
Hello madmat,
thanks for your reply. But sorry, this does not work :(
If i install Sugar 5 on the standard mysql port everything works fine.
But if i now copy the database from the standard port server to the mysql server with non-standard port and change the line above in config.php to the non-standard port ('127.0.0.1:1234'), i get the following error:
Code:
Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host '127.0.0.1:1234'
Other applications work very well on these settings...
But that is not really my problem. I am looking for a way to install sugar CRM 5.0 to a non-standard mysql port by default.
But if i try to set up the database host / port ('127.0.0.1:1234') in the installation dialogue of SugarCRM, i only get similar error messages.
Any ideas?
Re: How to install SugarCRM 5.0 on MySQL with non-standard port?
Hi,
Check out this one - looks like a solution: http://www.sugarcrm.com/forums/showt...ght=mysql+port
rgds
rl
Re: How to install SugarCRM 5.0 on MySQL with non-standard port?
Hello roblaus,
thanks for replying.
but as mentioned before: manipulating the config.php does not work for SugarCRM 5.0.0!
With SugarCRM 4.5.1 this works perfect, i can use the installation wizard with database hosts like '127.0.0.1:1234' but NOT with SugarCRM 5.0.0!
regards,
Benny
Re: How to install SugarCRM 5.0 on MySQL with non-standard port?
But implementing is then up to you...
the last post in this thread says (I did not try it):
I had the same problem, needed to run sugar using a mysql server listening on port 3307. Using the community php install script, there was no option to specify a mysql port during install and plugging in localhost:3307 for host did not work.
I added the following to install.php and include/entryPoint.php. Install went smooth, everything looks good. I'll repost if I have any trouble. Seems to work.
ini_set('mysqli.default_socket', '/tmp/mysql5.sock');
You need to change '/tmp/mysql5.sock' to whatever info your server jocks give you for the socket.
rgds
rl
Re: How to install SugarCRM 5.0 on MySQL with non-standard port?
Quote:
Originally Posted by bbergmann
but as mentioned before: manipulating the config.php does not work for SugarCRM 5.0.0!
With SugarCRM 4.5.1 this works perfect, i can use the installation wizard with database hosts like '127.0.0.1:1234' but NOT with SugarCRM 5.0.0!
Strange, for me it does very well.
Have you tried to install on standard port and change it afterwards?
Guessing by the link from roblaus it seems that only the installer might have a problem with that.
Re: How to install SugarCRM 5.0 on MySQL with non-standard port?
has anyone come across any more solutions or fixes for this very annoying problem yet (besides the socket suggestion above which is not feasible as my sugarcrm is in a shared hosting environment)? the other suggestions above also don't seems to work.
or perhaps anyone know if there is a fix currently in development?
thanks!
Re: How to install SugarCRM 5.0 on MySQL with non-standard port?
Somebody should file a bug at http://bugs.sugarcrm.com/ -- the ability to specify a port number should be part of Sugar's installer.
The temporary fix depends on whether you're using the mysql or mysqli extensions. Look at the error message you get... if the function referenced is mysql_connect(, follow these directions:
1) open ./include/database/MysqlManager.php and find this line:
PHP Code:
$this->database = mysql_connect($configOptions['db_host_name'],$configOptions['db_user_name'],$configOptions['db_password']) or sugar_die("Could not connect to server ".$configOptions['db_host_name']." as ".$configOptions['db_user_name'].".".mysql_error());
2) replace the above line with the following lines:
PHP Code:
$db_hostname = $configOptions['db_host_name'];
if (!empty($configOptions['db_port'])) {
$db_hostname .= ":{$configOptions['db_port']}";
}
$this->database = mysql_connect($db_hostname,$configOptions['db_user_name'],$configOptions['db_password']) or sugar_die("Could not connect to server ".$configOptions['db_host_name']." as ".$configOptions['db_user_name'].".".mysql_error());
3) save the file
4) open config.php and find the 'dbconfig' section, i.e.:
PHP Code:
'dbconfig' =>
array (
'db_host_name' => 'localhost',
'db_host_instance' => 'SQLEXPRESS',
5) add a line above the db_host_name parameter for db_port, i.e.:
PHP Code:
'dbconfig' =>
array (
'db_port' => '6920',
'db_host_name' => 'localhost',
'db_host_instance' => 'SQLEXPRESS',
6) save config.php and enjoy!
A similar fix for mysqli can be made in ./include/database/MysqliManager.php if you need to.
Re: How to install SugarCRM 5.0 on MySQL with non-standard port?
thanks for the reply.
just a question though - everyone seems to refer to finding the dbconfig section of the config.php and editing that - but my config.php is empty (it's empty in the original zipped files too...) - and as soon as I put anything in it the installer just shows a blank screen.