Jdbc does not link to mysql??

wrote a class to test the link MySQL:

// JDBC  URL
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";  
static final String DB_URL = "jdbc:mysql://localhost:3306/dbx?useSSL=false";
 
static final String USER = "root";
static final String PASS = "123456";
 
public static void main(String[] args) {
    Connection conn = null;
    Statement stmt = null;
    
    //  JDBC 
    Class.forName("com.mysql.jdbc.Driver");

    // 
    System.out.println("...");
    conn = DriverManager.getConnection(DB_URL,USER,PASS);//
    ...
  }

error content:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server

ask the great god to pass by and take a peek at what the problem is

Mar.08,2022

the mysql version does not match the driver


you can see that the version of the mysql-connector-java package you use has been com.mysql.cj.jdbc.Driver since 6.0. the driver is already com.mysql.cj.jdbc.Driver

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3dd6b-2c3db.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3dd6b-2c3db.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?