MySQL Connection error problem

Source: Internet
Author: User



1.java Tip: Java.lang.ClassNotFoundException:com.mysql.jdbc.Driver



Processing: Importing Mysql-connector-java-5.1.7-bin.jar



Import java.sql.Connection;
Import Java.sql.DriverManager;



try{
Connection con = null;
Class.forName ("Com.mysql.jdbc.Driver");
Con=drivermanager.getconnection ("Jdbc:mysql://10.0.1.1/ssworkplat", "root", "1111");
System.out.println ("OK");
}
catch (Exception e) {
E.printstacktrace ();
}






2. Cannot connect to the remote server, message from server: "Host ' 14.119.154.27 ' isn't allowed to connect to this MySQL server



Processing: Database Management



A. All addresses can be logged in



GRANT all privileges on * * to ' myuser ' @ ' percent ' identified by ' MyPassword ' with GRANT OPTION;
FLUSH privileges;



b, Specific IP



GRANT all privileges on * * to ' myuser ' @ ' 192.168.1.188 ' identified by ' MyPassword ' with GRANT OPTION;
FLUSH privileges;



3.Java.sql.SQLException:Access denied for user ' root ' @ ' 14.119.154.27 ' (using Password:yes)
--Password or user error



MySQL Connection error problem


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.