tech/SQL

mysql port change, mysql port 변경

lehero 2008. 11. 11. 23:56
참고 URL : http://forum.uniformserver.com/index.php?showtopic=1316



Not sure why you would want to change the MySQL port!
OK this is what you can try:
To change the default port 3306 to 3400

Steps:
1) Open file my-small located in folder:
*\Uniform Server\udrive\usr\local\mysql\bin

Change these lines :
[client]
#password=my_password
#port=3306
port=3400
#socket=MySQL

[mysqld]

#port=3306
port=3400

Moves the MySQL Server to port 3400

2) Open file php.ini located in folder:
*\Uniform Server\udrive\usr\local\php
(about line 669) --- I think this is the default (3306) you seeing
; at MYSQL_PORT.
;mysql.default_port =
mysql.default_port = 3400

(about line 704)
; at MYSQL_PORT.
;mysqli.default_port = 3306
mysqli.default_port = 3400

3) Open file config.inc.php located in folder:
*\Uniform Server\udrive\home\admin\www\phpMyAdmin
(about line 37)

$i++;
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
#$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['port'] = '3400'; // MySQL port - leave blank for default port

4) I think like I said
phpMyBackupPro picks up the default from php.ini
Hence shouldnot be a problem:

Note: If you need to do something like this:
define('DB_HOST', 'localhost:3400');
There is a serious problem with one of your set-up.

---------------

Note: If you need to do something like this: define('DB_HOST', 'localhost:3400');
There is a serious problem with one of your set-up.