MySQL使用中遇到的error

  • eclipse连接不上数据库
//加载驱动
        //oracal.jdbc.drive.Oracle.Driver
        //com.mysql.jdbc.Driver
        try {
            Class.forName("com.mysql.jdbc.Driver");
        } catch (ClassNotFoundException e) {
    
            e.printStackTrace();
        }
        Connection connection = null;
        try {
            connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/superlee", "Lee", "6666");
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        System.out.println(connection);

error:

错误原因: 连接的数据库名错误或连接的数据库未创建(不存在)。

原文地址:https://www.cnblogs.com/hsomelee/p/9047008.html