SecureCRT连接Ubuntu失败(远程系统拒绝访问)

原文链接:https://yq.aliyun.com/articles/58307

SecureCRT连接Ubuntu失败,长时间的重新连接,连接不了。

Ubuntu默认未安装ssh远程加密连接服务。

使用命令,安装即可。

sudo apt-get install openssh-server openssh-client

重启Ubuntu,默认已经开启ssh功能。

如果还是未连接,则

启动ssh-server:

/etc/init.d/ssh restart

检查ssh-server运行:

netstat -tlp

注:其中有ssh,则已启动运行。

ssh -l tskk localhost

测试即可。

 

展开阅读全文
博主设置当前文章不允许评论。

Java连接远程Mysql数据库失败

03-19

运行程序出现如下错误:rnrnrnC:\javatest>java OpratorBbsrncom.mysql.jdbc.CommunicationsException: Communications link failure due to underrnlying exception:rnrn** BEGIN NESTED EXCEPTION **rnrnjava.net.SocketExceptionrnMESSAGE: java.net.ConnectException: Connection refused: connectrnrnSTACKTRACE:rnrnjava.net.SocketException: java.net.ConnectException: Connection refused: connectrnrn at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.jarnva:156)rn at com.mysql.jdbc.MysqlIO.(MysqlIO.java:276)rn at com.mysql.jdbc.Connection.createNewIO(Connection.java:2641)rn at com.mysql.jdbc.Connection.(Connection.java:1531)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.javarn:266)rn at java.sql.DriverManager.getConnection(DriverManager.java:582)rn at java.sql.DriverManager.getConnection(DriverManager.java:185)rn at OpratorBbs.main(OpratorBbs.java:13)rnrnrn** END NESTED EXCEPTION **rnrnrnrnLast packet sent to the server was 16 ms ago.rn at com.mysql.jdbc.Connection.createNewIO(Connection.java:2707)rn at com.mysql.jdbc.Connection.(Connection.java:1531)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.javarn:266)rn at java.sql.DriverManager.getConnection(DriverManager.java:582)rn at java.sql.DriverManager.getConnection(DriverManager.java:185)rn at OpratorBbs.main(OpratorBbs.java:13)rnrnC:\javatest>rnrnrn我的java源代码:rnrnrn[code=Java]rnrnimport java.sql.*;rnimport java.net.*;rnrnclass OpratorBbsrn public static void main(String []args)rn rn tryrn Class.forName("com.mysql.jdbc.Driver"); rn catch(Exception e)rn e.printStackTrace();rn rn tryrn Connection conn= DriverManager.getConnection("jdbc:mysql://192.168.0.1:3306/bbs","root","123456"); rn Statement stmt = conn.createStatement();rn ResultSet rs = stmt.executeQuery("select * from uchome_member limit 10000");rn rn while(rs.next())rn System.out.println(rs.getString("username")); rn rn catch(Exception e)rn e.printStackTrace(); rn rn rnrnrn[/code] 论坛

没有更多推荐了,返回首页