473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Can't connect to mysql server with J Connector.

I can't connect to mysql server using the mysql-connector-java-3.0.11.
I was able to run the same program when I was running Suse 9.0 but
since I install Suse 9.1, I can't connect.
The error message is:
java.sql.SQLException: Unable to connect to any hosts due to
exception: java.net.ConnectException: Connection refused

I'm using mysql-standard-4.0.14 and able to get in the mysql server by
typing:
bin/mysql -uroot -ptest
The /etc/my.cnf file is the default one from
support-files/my-medium.cnf
The #skip-networking is comment out.
Try to telnet localhost 3306 and it display the following text:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
4
4.0.14-standard-log|0x-qw$E,Connection closed by foreign host.
Jul 20 '05 #1
4 2989
Denis Labon wrote:
I can't connect to mysql server using the mysql-connector-java-3.0.11.
I was able to run the same program when I was running Suse 9.0 but
since I install Suse 9.1, I can't connect.
The error message is:
java.sql.SQLException: Unable to connect to any hosts due to
exception: java.net.ConnectException: Connection refused


Since you have already ruled out that the mysqld is not running or is
started with --skip-networking, then perhaps you are not calling the
Java method getConnection() correctly? Make sure you are passing valid
connect URL string, and correct user and password.

For another possible reason, read this bug:
https://bugzilla.redhat.com/bugzilla...g.cgi?id=77467

I know you said you're running on SuSE, not Red Hat, but it still might
be relevant. The bug comments give a couple of possible changes that
can resolve the problem.

Good luck,
Bill K.
Jul 20 '05 #2
Denis Labon wrote:
I can't connect to mysql server using the mysql-connector-java-3.0.11.
I was able to run the same program when I was running Suse 9.0 but
since I install Suse 9.1, I can't connect.
The error message is:
java.sql.SQLException: Unable to connect to any hosts due to
exception: java.net.ConnectException: Connection refused


Since you have already ruled out that the mysqld is not running or is
started with --skip-networking, then perhaps you are not calling the
Java method getConnection() correctly? Make sure you are passing valid
connect URL string, and correct user and password.

For another possible reason, read this bug:
https://bugzilla.redhat.com/bugzilla...g.cgi?id=77467

I know you said you're running on SuSE, not Red Hat, but it still might
be relevant. The bug comments give a couple of possible changes that
can resolve the problem.

Good luck,
Bill K.
Jul 20 '05 #3
Bill Karwin wrote:
started with --skip-networking, then perhaps you are not calling the
Java method getConnection() correctly? Make sure you are passing valid
connect URL string, and correct user and password.
I just reinstall Suse 9.0 and the program work perfectly. I didn't
even have to compile it. The program is a simple program that connect
to the mysql server and get out.

For another possible reason, read this bug:
https://bugzilla.redhat.com/bugzilla...g.cgi?id=77467

If I understand correctly, the bug is related to glibc. Unfortunately,
I overide Suse9.1, I can not try to put the setting
"set-variable=thread_stack=256k" and see if it works. However, I don't
believe it has anything to do with glibc. The version they are talking
about is glibc-2.2.4-18.7.0.7 and the glibc version of Suse 9.0 is
2.3.2-88 and the glibc version of Suse 9.1 is 2.3.3. So, logically it
should works.

Does anyone know what is require for the mysql Java connector to work
with mysql?(type of environment, libraries,..., low-level stuff ).

thanx!
Jul 20 '05 #4
Bill Karwin wrote:
started with --skip-networking, then perhaps you are not calling the
Java method getConnection() correctly? Make sure you are passing valid
connect URL string, and correct user and password.
I just reinstall Suse 9.0 and the program work perfectly. I didn't
even have to compile it. The program is a simple program that connect
to the mysql server and get out.

For another possible reason, read this bug:
https://bugzilla.redhat.com/bugzilla...g.cgi?id=77467

If I understand correctly, the bug is related to glibc. Unfortunately,
I overide Suse9.1, I can not try to put the setting
"set-variable=thread_stack=256k" and see if it works. However, I don't
believe it has anything to do with glibc. The version they are talking
about is glibc-2.2.4-18.7.0.7 and the glibc version of Suse 9.0 is
2.3.2-88 and the glibc version of Suse 9.1 is 2.3.3. So, logically it
should works.

Does anyone know what is require for the mysql Java connector to work
with mysql?(type of environment, libraries,..., low-level stuff ).

thanx!
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Massimiliano Marcon | last post by:
I'm triyng to install mysql server with rpm on a linux red hat 9.0 machine. The installation was succesfully, but now I can't start the server. I think the right command is mysqld_safe --user=mysql...
1
by: ConTactMe | last post by:
I get the following error when trying to create an Access Data Project: Login failed for user 'myname'. Reason: Not associated with a trusted SQL Server connection. I'm using a specific...
0
by: Andy | last post by:
I hv just kill the mysql server process ( by killing the process ID ) , not normally shutdown the mysql server ( mysql stop ) , now the mysql can't start , I also can't find any process related to...
0
by: ryanmhuc | last post by:
I have root access to this server which has been preconfigured. I can connect using the mysql command tool. But I cannot connect using any mysql GUI software (I am currently tunneling the 3306 port...
2
by: xiuchuanli | last post by:
I install Fedora 4 with web server, after that I installed mysql 5.0.15. Now I can connect to mysql from command line and mysql-administrator and mysql-query-browser. But when I try to test to...
0
by: xiuchuanli | last post by:
I install Fedora 4 with web server, after that I installed mysql 5.0.15. Now I can connect to mysql from command line and mysql-administrator and mysql-query-browser. But when I try to test to...
1
by: shun | last post by:
Hello, I need an sample program to connect mysql server by using odbc. thanks in advance
3
by: joysana | last post by:
Hi, Dear friends, how can I connect database MS SQL server mobile sersion 2005 using mobile tools with C#. and what is requirements? .....joy
3
by: likigoldenstar | last post by:
Hi, I have some problem in developing program using PHP. I 'll explain my platforms: I use appserv-win32-2.5.9 as a app server. In the server, mysql client version is 5.0.37 Problems:
1
by: akshay mokhalga | last post by:
I have to connect my database Mysql to my C program how can I do this???
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.