Wednesday, February 16, 2011

MySQL- User exist then also error cause in connection string

Hello,
In this post I will share some logical error while your connecting MySQL database with any technologies like java,dot net etc.
If you create a user in mysql for accessing database/table/column etc.
and you using this user for accessing from webapp or desktop.
And you getting some error like if user name was newuser, host name was localhost and password and privileges are set for that user then your connection string for localhost like jdbc:mysql://localhost:3306/dbname
username=newuser, password = <password>,

so now you have create user in mysql like username=newuser, host name=% etc,
It might be some time causing error for localhost so for that you have create same user with same name, password and privileges but the host name was set to localhost.

now in your local system it will be run same like on another server system.
hope you got some idea by this post.
thank you.