Re: Connector/J "Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost."
Posted by: Jean-Nicolas Duval
Date: June 02, 2008 07:29PM

I had this problem giving me headaches too!! I finally sovled it by editing my configuration file, my.cnf (commenting the last line of the following; i.e #skip-networking) :

# The MySQL server
[mysqld]
port = 3306
socket = /opt/lampp/var/mysql/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking




As some might have noticed, I am using LAMPP for Mysql so I restarted it (with $sudo lampp restart) and the problem is solved! (For mysqld the dommand would be $service mysqld restart).

I know this might decrease the security of my system but one can use the GRANT PRIVILIGES option to avoid intrusions...

Options: ReplyQuote


Subject
Written By
Posted
Re: Connector/J "Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost."
June 02, 2008 07:29PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.