用Eclipse连接MySQL数据库报错了怎么回事

用Eclipse连接MySQL数据库报错了怎么回事

package com.until;

import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.*;

public class DBUtil {

public Connection conn=null;


public DBUtil(String account, String password, String database){
    //连接驱动
    try{
        Class.forName("com.mysql.jdbc.Driver");
        System.out.println("加载驱动成功");
    }
    catch(Exception e){
        System.out.println("加载驱动失败");
    }
    
    try{
        String url="jdbc:mysql://localhost::3306/"+database+"characterEncoding=utf-8&&useSSL=false";
        conn=DriverManager.getConnection(url,account, password);
        System.out.println("连接数据库成功");
        
    }catch(SQLException e1){
        System.out.println("----------------------------");
        System.out.println("连接数据库失败");
        e1.printStackTrace();//打印报错信息
        System.out.println("----------------------------");
    }
    //连接数据库
    
}

}

加载驱动成功

连接数据库失败
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: ":3306"'.

按照视频打的代码,能出现登陆框但是有报错

localhost:3306不是localhost::3306

img

img