LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "Lost connection to MySQL server" when using different port (https://www.linuxquestions.org/questions/linux-newbie-8/lost-connection-to-mysql-server-when-using-different-port-877567/)

jonaskellens 04-28-2011 04:38 AM

"Lost connection to MySQL server" when using different port
 
Hello,

I'm getting the following error on my webpage :

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /var/www/vhosts/...

When I use the default MySQL port 3306, then I have no error.

But when I use port 33060, then I get the error !

My /etc/my.cnf :
Code:

[mysqld]
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
user=mysql

old_passwords=1
port = 33060

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Even when port=33060 still I can connect on port 3306 without any error.

Does anyone know a solution ?

omgs 04-28-2011 07:18 AM

I think you have a php problem. Find how to connect to a different mysql host:port


All times are GMT -5. The time now is 06:35 PM.