麻烦与Web托管的MySQL [英] Having Trouble with web hosted MySQL

查看:86
本文介绍了麻烦与Web托管的MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用我的webHosting站点上托管的mySQL服务器连接我的桌​​面应用程序并面对此例外请帮助!

MY CODE:

I am trying to Connect My Desktop application with mySQL server that is hosted on my webHosting Site and Facing This Exception Please Help!
MY CODE:

public static void main(String[] args) {
		try {
			Class.forName ("com.mysql.jdbc.Driver");
			String url = "jdbc:mysql://mysql.1freehosting.com/u114747985_mydb";
			Connection connection = DriverManager.getConnection(url);
			JOptionPane.showMessageDialog(null,"Success!");
		} catch (Exception e) {
			// TODO: handle exception
			JOptionPane.showMessageDialog(null,e.toString());
			e.printStackTrace();
		}
	}
	
}




<br />
SQLException: null,  message from server: "Host '119.156.14.70' is not allowed to connect to this MySQL server"<br />
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)<br />
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)<br />
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)<br />
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1128)<br />
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2336)<br />
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2369)<br />
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153)<br />
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)<br />
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)<br />
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)<br />
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)<br />
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)<br />
	at java.lang.reflect.Constructor.newInstance(Unknown Source)<br />
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)<br />
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)<br />
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)<br />
	at java.sql.DriverManager.getConnection(Unknown Source)<br />
	at java.sql.DriverManager.getConnection(Unknown Source)<br />
	at MyTest.main(MyTest.java:16)<br />

推荐答案

使用谷歌会发现你 http://stackoverflow.com /问题/ 1559955 /主机-XXX-XX-XX x-xxx-is-not-allow-to-to-this-mysql-server [ ^ ]。
The use of Google would have found you http://stackoverflow.com/questions/1559955/host-xxx-xx-xxx-xxx-is-not-allowed-to-connect-to-this-mysql-server[^].


检查防火墙设置并为其端口添加mysql的execption
check firewall settings and add execption for mysql for its port


亲爱的,你安装了Skype吗?如果是,请将其删除并重试。可能是这个问题
dear did you installed the skype? if yes please remove it and try again.may this is the problem


这篇关于麻烦与Web托管的MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆