0

I have a linux server that I access with putty.

I access my mysql database of that server with the program SQuirrel SQL client.

And everything works. Now I buyed a new windows computer and I wanted to install all the same applications to access my linux server.

I can access my server with putty very well.

I installed SQuirrel and put the same drivers, properties to access the database, but i does not work.

I get the following error:

MESSAGE: Connection refused: connect

STACKTRACE:

java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
    at java.net.Socket.connect(Socket.java:579)
    at java.net.Socket.connect(Socket.java:528)
    at java.net.Socket.<init>(Socket.java:425)
    at java.net.Socket.<init>(Socket.java:208)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:121)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:220)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:1768)
    at com.mysql.jdbc.Connection.<init>(Connection.java:440)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400)
    at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)


** END NESTED EXCEPTION **

How can i fix this ?

Nakilon
  • 34,866
  • 14
  • 107
  • 142
Bigjo
  • 613
  • 2
  • 10
  • 32

1 Answers1

0

1

Edit the /etc/my.cnf

run: vi /etc/my.cnf

look for bind-address=YOUR-SERVER-IP and comment it out.


2 Grant access to a new database

If you want to add a new database called foo for user bar and remote IP 202.54.10.20 then you need to type the following commands at

mysql> prompt:
mysql> CREATE DATABASE foo;
mysql> GRANT ALL ON foo.* TO bar@'202.54.10.20' IDENTIFIED BY 'PASSWORD';

How Do I Grant Access To An Existing Database?

Let us assume that you are always making connection from remote IP called 202.54.10.20 for database called webdb for user webadmin, To grant access to this IP address type the following command At

 mysql> prompt for existing database, enter:
 mysql> update db set Host='202.54.10.20' where Db='webdb';
 mysql> update user set Host='202.54.10.20' where user='webadmin';

exit mysql,

you will now have to restart your mysql server instance this should allow you to remotely connect.

Mike
  • 1,158
  • 5
  • 22
  • 32
  • I didn't have to do that on my previous computer. I don't access het database with my IP Adress, but with the root user I use on the server. I opened putty and normaly than I could connect on my server en mysql database. Buy on this computer (windows 7) it doesn't work – Bigjo Apr 03 '14 at 08:01