[Solved]: How to change coppermine database port [Solved]: How to change coppermine database port
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: How to change coppermine database port

Started by kazekun, December 10, 2008, 10:52:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kazekun

I've installed coppermine with database connection on port 3306 some time ago and it's working fine.  Recently, I need to change the mysql database from the default port to another port .  Now when I try to access the photo gallery, it says

Coppermine critical error:
Unable to connect to database !

MySQL said: Lost connection to MySQL server at 'reading initial communication packet', system error: 111

I've googled around and found a similar post (http://forum.coppermine-gallery.net/index.php?topic=53674.0) with the solution of "Edit include/config.inc.php and specify the port. For example localhost:3305".  I would like to ask how to make the aforementioned change in the config.php.  In the config.php, it has

// MySQL configuration
$CONFIG['dbserver'] =                         '127.0.0.1';        // Your database server
$CONFIG['dbuser'] =                         'xxxx';        // Your mysql username
$CONFIG['dbpass'] =                         'xxxx';                // Your mysql password
$CONFIG['dbname'] =                         'xxxxi';        // Your mysql database name

So where do I add in the new port number? I tried $CONFIG['dbserver'] = '127.0.0.1:23800' and it didn't work.

Hein Traag


kazekun

Cannot use localhost:xxxxx, because my apache is in chroot, so the mysql.sock is not in the default /tmp/mysql.sock.  That's why in the user account I need to set host part as 127.0.0.1 instead of localhost in the first place.  I tried the suggestion of localhost:xxxxx (also created user account 'username'@'localhost' in mysql for this purpose), which resulted in the following error message:

Coppermine critical error:
Unable to connect to database !

MySQL said: Can't connect to local MySQL server through socket '/chroot/apache/tmp/mysql.sock' (2)

kazekun

Actually, got it working now by using 'server_ipaddr:23800'.  (tried it before but I seemed to have put the wrong port number in at that time).  Anyway, many thanks for your help! ^_^

Hein Traag

Your welcome and thanks for the info on the port number setting. Bound to be usefull to others.