Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

MySQL connection refused::

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
macawgumbo
Apprentice
Apprentice
Posts: 165
Joined: Fri May 28, 2004 1:12 am

MySQL connection refused::

  • Quote

Post by macawgumbo » Tue Jan 17, 2006 10:40 pm

I am trying to connect from my Windows laptop via Zend Studio 5.0 Enterprise to my Gentoo Linux Server and MySQL 4.0.x install. The server is working locally (eg. phpmyadmin works fine and so does logging in at the prompt). However, it does not accept connections remotely as the Zend Studio attempt is replied with connection refused. Any ideas? I have added a user with full privileges on all tables from all login places. Still doesn't work.
**The man with one ball uses Linux, the man with both uses Gentoo. Who do you think performs better?**
Top
psycepa
Veteran
Veteran
User avatar
Posts: 1637
Joined: Mon Dec 27, 2004 6:00 pm
Location: Poland

  • Quote

Post by psycepa » Wed Jan 18, 2006 12:23 am

does your server accept connection from other hosts ? what do you have in /etc/hosts.allow and /etc/hosts.deny ?
RLUNo. 376073
bo czytac, to trzeba ze zrozumieniem (c) by psycepa
"nigdy nie kloc sie z glupcem, najpierw sprowadzi cie do swojego poziomu a potem pokona doswiadczeniem"
"Life is complex. It has its real and imaginary part."
Top
macawgumbo
Apprentice
Apprentice
Posts: 165
Joined: Fri May 28, 2004 1:12 am

  • Quote

Post by macawgumbo » Thu Jan 19, 2006 11:55 pm

have not edited hosts.allow or hosts.deny. I found the workaround for my problem though. I am developing on a WinXP machine and found WAMP which installs the latest versions of apache mysql and php in one simple installshield wizard. Now I am using Zend Studio to develop and connect to the local mysql db. I edit hosts.allow now.
**The man with one ball uses Linux, the man with both uses Gentoo. Who do you think performs better?**
Top
rojanu
Guru
Guru
User avatar
Posts: 361
Joined: Mon Feb 02, 2004 5:56 pm
Location: London

  • Quote

Post by rojanu » Tue Jan 24, 2006 11:35 am

I have the same problem here trying to use mysql on a gentoo box from winXP using mysql-jdbc driver the error I get is
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused: connect

STACKTRACE:

java.net.SocketException: java.net.ConnectException: Connection refused: connect
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2592)
at com.mysql.jdbc.Connection.<init>(Connection.java:1509)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at main.data.UserDa.initialize(UserDa.java:38 )
at main.data.User.initialize(User.java:35)
at main.MainExecuter.initialise(MainExecuter.java:17)
at main.MainExecuter.main(MainExecuter.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)


** END NESTED EXCEPTION **



Last packet sent to the server was 31 ms ago.
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2658)
at com.mysql.jdbc.Connection.<init>(Connection.java:1509)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at main.data.UserDa.initialize(UserDa.java:38 )
at main.data.User.initialize(User.java:35)
at main.MainExecuter.initialise(MainExecuter.java:17)
at main.MainExecuter.main(MainExecuter.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
code trying to access mysql

Code: Select all

public static void initialize() throws Exception
	{
		try
		{
			Class.forName("com.mysql.jdbc.Driver");
			dbcon = DriverManager.getConnection("jdbc:mysql://192.168.1.159:3306/blue","user","password");
			statement = dbcon.createStatement();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
Any ideas!!
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler,
Linux User: #416714
Top
magic919
Advocate
Advocate
Posts: 2182
Joined: Fri Jun 17, 2005 7:31 am
Location: Berkshire, UK

  • Quote

Post by magic919 » Tue Jan 24, 2006 7:35 pm

1. Start a new thread.

2. Check netstat -tunlp and make sure MySQL is listening on 3306.

3. Check my.cnf and read comments if not.
Top
Post Reply

5 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic