java - Database Access Denied connection issue -


i trying make mysql database connection war file using jdbc connection string shown below:-

    string connectionurl = "jdbc:mysql://localhost:3306/databasename? user=databaseusername;password=databasepassword"; 

now war file , database both available on server, & doing execution server itself. problem getting below error says:-

    info: java.sql.sqlexception: access denied user 'grandsho_root;password=pwd'@'localhost' (using password: no) 

where

grandsho_root user, pwd password ...i need know problem? need perform grant command. or that?

when message "(using password: no)" means trying connect without password set. log message tells user "grandsho_root;password=pwd" not allowed connect. means connection string wrong because use ; separate parameters instead of &. how connection string should look:

jdbc:mysql://localhost:3306/databasename?user=sqluser&password=sqluserpw 

when still have problems please check if user set correctly. check grandsho_root has password set, allowed connect localhost , granted necessary privileges schema.

also check mysql documentation here