java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)

后端 未结 5 1501
挽巷
挽巷 2021-01-21 14:15

I\'m having troubles with my project , it involves JDBC and Mysql connection .

When I do the following :

private Statement m_         


        
5条回答
  •  野的像风
    2021-01-21 14:54

    TO check if mysql has a password, go to the directory where you installed mysql, and in the bin directory try to bring up mysql prompt using

    ./mysql –u root mysql

    If the login goes through without any problem, it means no password is set.
    You can use mysqadmin script to set/reset password.

    ./mysqladmin –u root password "password string"

提交回复
热议问题