为了方便用户记忆,我们将IP变成一个个的域名来输入到浏览器进行访问。而这使得访问网站时要先将其域名解析成 IP 。DNS (Domain Name Server) 的作用就是进行 IP 解析,把域名对应到 IP。在 Great FireWall 的 5 种封锁方法中,有一种简单而效果很好的方法是 DNS 污染。GFW 会对 DNS 的解析过程进行干扰,这会使对某些被干扰的域名返回一个错误的 IP 地址给你的主机,使你无法正确连接到你要的服务器上读取正确的信息。Hosts 文件本来是用来提高解析效率。
在进行 DNS 请求以前,系统会先检查自己的 Hosts 文件中是否有这个地址映射关系,如果有则调用这个 IP 地址映射,如果没有再向已知的 DNS 服务器提出域名解析。也就是说 Hosts 的请求级别比 DNS 高。当你的 Hosts 文件里面有对应的 IP 时,它就会直接访问那个 IP,而不用通过 DNS。
所以,当我们直接将 Google、Twitter、Facebook 之类的 IP 放入 Hosts 文件后,就可以跳过 DNS 的解析这一步,直接就行 IP 访问,不受 GFW 的 DNS 污染干扰了。补充一条,就是为什么 Hosts 的 IP 要时不时更改,为什么 FB、Twitter 会仍旧上不去。是因为 GFW 的第二个大招,IP 封锁。比如访问国外一个 IP 无法访问,Ping 不通,tracert 这个 IP 后发现,全部在边缘路由器 (GFW) 附近被拦截。换言之,GFW 直接拦截带有这个 IP 头的数据包。所以,如果你更改的 IP 被封锁了,就算你过了 DNS 这一关,也仍旧不能翻过 GFW。
publicstaticvoidmain(String[] args){ try { //1、加载驱动类 Class.forName("com.mysql.jdbc.Driver"); //2、获取数据库连接对象connection //jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8 Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test4","root", "root"); //System.out.println(conn); //3、通过connection 获取操作数据库的对象 statement Statement sta = conn.createStatement(); //4、使用statement对象操作数据库完成相应的业务 //2.1 将数据库的事务提交方式设为手动 conn.setAutoCommit(false); int a = sta.executeUpdate("delete from company where company_id in (9,10)"); int b = sta.executeUpdate("delete from company where company_id = 1 "); int c = sta.executeUpdate("insert into company(company_id,company_name) values(null,'ccc')"); int d = sta.executeUpdate("insert into company(company_id,company_name) values(3,'ddd')"); //ResultSet rs = sta.executeQuery("select * from people"); //2.2 提交事务单元 conn.commit(); //5、处理结果集 System.out.println(a + b + c + d); // while(rs.next()){ // System.out.println(rs.getString("name")+"---"+rs.getString("idcard")); // } //6、关闭资源,释放空间。 if(conn!=null){ conn.close(); } }catch (ClassNotFoundException e) { e.printStackTrace(); }catch (SQLException e) { e.printStackTrace(); } } }
WARNING: configuration download directory "/tmp/pear/install" is not writeable. Change download_dir config variable to a writeable dir to avoid this warning
WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update
Cannot install, php_dir for channel "pear.php.net" is not writeable by the current user
czhdeMacBook-Pro:~ czh$ sudo pear install Mail
Password:
WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update
Did not download optional dependencies: pear/Net_SMTP, use --alldeps to download automatically
pear/Mail can optionally use package "pear/Net_SMTP" (version >= 1.4.1)
downloading Mail-1.4.1.tgz ...
Starting to download Mail-1.4.1.tgz (21,756 bytes)
PEAR: Optional feature webinstaller available (PEAR's web-based installer) PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer) PEAR: To install optional features use "pear install pear/PEAR#featurename" ****************************************************************************** WARNING! The include_path defined in the currently used php.ini does not contain the PEAR PHP directory you just specified: If the specified directory is also not in the include_path used by your scripts, you will have problems getting any PEAR packages working. Would you like to alter php.ini ? [Y/n] : Y php.ini include_path updated. Current include path : .: Configured directory : /usr/local/pear/share/pear Currently used php.ini (guess) : /usr/local/etc/php/7.0/php.ini Press Enter to continue: The 'pear' command is now at your service at /usr/local/bin/pear
**1.1:**ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL server
方法:http://blog.csdn.net/july_2/article/details/41896295
注意:这里面要注意人家写的用户名 和 密码 这是自己的,千万不要像我一样直接抄,不然报错eg:1.3
**1.2:**ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
原因:在安装完msyql之后,的初始化配置文件中,我把validate_password_policy =1,所以当给新的用户注册密码时,简单密码是通不过的。
方法:http://www.cnblogs.com/ivictor/p/5142809.html
**1.3:**ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
原因:就是密码输错的,笨蛋!就知道抄,不去理解人家的意思!看图一
方法:http://www.cnblogs.com/kerrycode/p/4368312.html
**1.4:** Permission denied, please try again(publickey,password)
原因:由于您没有将公钥( publickey ) 添加到本地 ssh 环境造成的,或者是由于多日未 进行ssh 登录操作,本地 publickey 失效造成的
方法:http://www.mr-wu.cn/ssh-permission-denied-publickey/
http://blog.csdn.net/weixin_36397141/article/details/54618867
https://zhidao.baidu.com/question/188203613.html
以上三步我都做了。第一步是重点!
补充:http://www.cnblogs.com/jiangyao/archive/2011/01/26/1945570.html scp的操作
VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security. It checks the strength of password and allows the users tosetonly those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: y
There are three levels of password validation policy:
LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and2 = STRONG: 1 Using existing password for root.
Estimated strength of the password: 50 Change the password for root ? ((Press y|Y for Yes, any other key for No) : l
... skipping. By default, a MySQL installation hasan anonymous user, allowing anyone tolog into MySQL without having to have a user account created for them. This is intended onlyfor testing, andtomake the installation goa bit smoother. You should remove them before moving into a production environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : l
... skipping.
Normally, root should onlybe allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : l
... skipping. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended onlyfor testing, and should be removed before moving into a production environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : l
... skipping. Reloading the privilege tables will ensure that allchanges made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success.