If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Connecting to MySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-27-04, 11:25
KolyaA KolyaA is offline
Registered User
 
Join Date: Feb 2004
Location: Peterburg, Russija
Posts: 7
Unhappy Connecting to MySQL

When i try to connect to MySQL, i cannot do it .

The message in log file MyServe.err is:

Number of processes running now: 0
040227 13:25:04 mysqld restarted
040227 13:25:04 InnoDB: Started
/usr/local/libexec/mysqld: ready for connections.
Version: '4.0.15-log' socket: '/tmp/mysql.sock' port: 3306


I connect from java file:

import java.sql.*;

public class CoreConnect{
public static void main(String[] args){
try{
Class.forName("com.mysql.jdbc.Driver");
}catch(Exception e){
e.printStackTrace();
}
try{
Connection c =
DriverManager.getConnection("jdbc:mysql://localhost:3306/test?user=kolya");
c.close();
}catch (SQLException e){
e.printStackTrace();
}
}
}

in java i get ecception: java.sql.SQLException: Communication link failure: java.io.EOFException, underlying cause: null
Reply With Quote
  #2 (permalink)  
Old 02-27-04, 19:25
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: Connecting to MySQL

Quote:
Originally posted by KolyaA
When i try to connect to MySQL, i cannot do it .

The message in log file MyServe.err is:

Number of processes running now: 0
040227 13:25:04 mysqld restarted
040227 13:25:04 InnoDB: Started
/usr/local/libexec/mysqld: ready for connections.
Version: '4.0.15-log' socket: '/tmp/mysql.sock' port: 3306


I connect from java file:

import java.sql.*;

public class CoreConnect{
public static void main(String[] args){
try{
Class.forName("com.mysql.jdbc.Driver");
}catch(Exception e){
e.printStackTrace();
}
try{
Connection c =
DriverManager.getConnection("jdbc:mysql://localhost:3306/test?user=kolya");
c.close();
}catch (SQLException e){
e.printStackTrace();
}
}
}

in java i get ecception: java.sql.SQLException: Communication link failure: java.io.EOFException, underlying cause: null
Try "telnet localhost 3306" from shell. If you could to connect than probably is problem in your code or jdbc.
Reply With Quote
  #3 (permalink)  
Old 03-01-04, 06:21
KolyaA KolyaA is offline
Registered User
 
Join Date: Feb 2004
Location: Peterburg, Russija
Posts: 7
Re: Connecting to MySQL

Quote:
Originally posted by ika
Try "telnet localhost 3306" from shell. If you could to connect than probably is problem in your code or jdbc.
Thank you.

When i tried "telnet localhost 3306", i received message:

astro!kolya:~ >telnet localhost 3306
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
You are not welcome to use mysqld from localhost.
Connection closed by foreign host.

My administrator don't know what to do. He think reason in options
of mysql, but he don't know about mysql. Does he right?
Reply With Quote
  #4 (permalink)  
Old 03-01-04, 06:31
KolyaA KolyaA is offline
Registered User
 
Join Date: Feb 2004
Location: Peterburg, Russija
Posts: 7
Re: Connecting to MySQL

P.S. Simply "telnet localhost" works good
Reply With Quote
  #5 (permalink)  
Old 03-01-04, 14:35
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: Connecting to MySQL

Quote:
Originally posted by KolyaA
P.S. Simply "telnet localhost" works good
telnet localhost (without port specification) means you are telneting to default telnet port 23. If telnet localhost 3306 returns "Connection refused" it means your MySQL server is not running.
If connection is successfully opened from localhost (to 3306) and if you receiving "Connection refused" when you connecting from anther machine, then check for firewall rules.
Reply With Quote
  #6 (permalink)  
Old 03-02-04, 04:37
KolyaA KolyaA is offline
Registered User
 
Join Date: Feb 2004
Location: Peterburg, Russija
Posts: 7
Re: Connecting to MySQL

Quote:
Originally posted by ika
telnet localhost (without port specification) means you are telneting to default telnet port 23. If telnet localhost 3306 returns "Connection refused" it means your MySQL server is not running
I think it is running. "Connection refused" concerns to "adress ::1".
Atter that it "trying 127.0.0.1" and "Connected to localhost"
But after each attempt "mysqld restarted" in errror log file

Quote:
[SIZE=1If connection is successfully opened from localhost (to 3306) and if you receiving "Connection refused" when you connecting from anther machine, then check for firewall rules. [/SIZE]
"telnet localhost 3306" unsuccessful in all cases. And each time i receive the same message(as in my previous reply)
Reply With Quote
  #7 (permalink)  
Old 03-02-04, 05:31
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: Connecting to MySQL

Quote:
Originally posted by KolyaA
I think it is running. "Connection refused" concerns to "adress ::1".
Atter that it "trying 127.0.0.1" and "Connected to localhost"
But after each attempt "mysqld restarted" in errror log file



"telnet localhost 3306" unsuccessful in all cases. And each time i receive the same message(as in my previous reply)
Ok clud you explain your architecture (OS and from where you are connecting to mysql (localhst or another host))
BTW, What the error log say?
Reply With Quote
  #8 (permalink)  
Old 03-02-04, 06:21
KolyaA KolyaA is offline
Registered User
 
Join Date: Feb 2004
Location: Peterburg, Russija
Posts: 7
Re: Connecting to MySQL

I am connecting from localhost.
OS is: FreeBSD 5.0
MySQL-server 4.0.18-log
MySQL-client 4.0.18

Error log say:

Number of processes running now: 0
040301 14:03:23 mysqld restarted
040301 14:03:24 InnoDB: Started
/usr/local/libexec/mysqld: ready for connections.
Version: '4.0.15' socket: '/tmp/mysql.sock' port: 3306
Reply With Quote
  #9 (permalink)  
Old 03-02-04, 07:17
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: Connecting to MySQL

Quote:
Originally posted by KolyaA
I am connecting from localhost.
OS is: FreeBSD 5.0
MySQL-server 4.0.18-log
MySQL-client 4.0.18

Error log say:

Number of processes running now: 0
040301 14:03:23 mysqld restarted
040301 14:03:24 InnoDB: Started
/usr/local/libexec/mysqld: ready for connections.
Version: '4.0.15' socket: '/tmp/mysql.sock' port: 3306
It was compiled (mysql) or it was installed from binary package?
Are u sing mysql with linuxthreads or not?
Reply With Quote
  #10 (permalink)  
Old 03-02-04, 10:35
KolyaA KolyaA is offline
Registered User
 
Join Date: Feb 2004
Location: Peterburg, Russija
Posts: 7
Re: Connecting to MySQL

MySQL was compilied and installed from the corresponding FreeBSD ports (mysql-server-4.0 and mysql-cli-4.0).

Linuxthreads are not using.
Reply With Quote
  #11 (permalink)  
Old 03-02-04, 14:25
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: Connecting to MySQL

Quote:
Originally posted by KolyaA
MySQL was compilied and installed from the corresponding FreeBSD ports (mysql-server-4.0 and mysql-cli-4.0).

Linuxthreads are not using.
I found the same problem but without solution: http://lists.freebsd.org/pipermail/f...er/023808.html

OK, try download binary package for freebsd from www.mysql.com and try install it. Then copy datafiles from old mysql to the new mysql.
Try run it and let me know if it is running without problems.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On