📌  相关文章
📜  java.sql.sqlexception:用户'root'@'localhost'的访问被拒绝(使用密码:否) - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:23.850000             🧑  作者: Mango

代码示例3
As you are creating a database from scratch, you could use:

Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/?user=root&password=rootpassword"); 
PreparedStatement ps = connection.prepareStatement("CREATE DATABASE databasename");
int result = ps.executeUpdate();