Advanced search  

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

Pages: [1]   Go Down

Author Topic: [Solved]: How to change coppermine database port  (Read 6887 times)

0 Members and 1 Guest are viewing this topic.

kazekun

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
[Solved]: How to change coppermine database port
« on: December 10, 2008, 10:52:31 am »

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.
« Last Edit: December 10, 2008, 02:38:47 pm by Nibbler »
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: How to change coppermine database port
« Reply #1 on: December 10, 2008, 11:05:01 am »

Have you tried localhost:23800 ?
Logged

kazekun

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: How to change coppermine database port
« Reply #2 on: December 10, 2008, 02:03:31 pm »

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)
Logged

kazekun

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: How to change coppermine database port
« Reply #3 on: December 10, 2008, 02:11:39 pm »

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! ^_^
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: How to change coppermine database port
« Reply #4 on: December 10, 2008, 02:20:33 pm »

Your welcome and thanks for the info on the port number setting. Bound to be usefull to others.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.