Sunday, February 12, 2012

cannot connect to database: Login failed for user

Hello everyone,

When I try to connect to database I get this error message: Login failed for user 'databaseadmin'.

My connection code is:

Dim MyConnection As New SqlConnection( _
"server=(local); database=news; UID=databaseadmin; PWD=111111;")

I've tried "server=localhost:3066", and "server=." and many many other ways, but it's still not working! I don't know what other things should I try now... I asked the support people of my web host, and their answer is:"Mysql database usename and password is corect one. It seems that there is problem with the script code."

Please would anybody help me with this? Thank you very much!

If you are trying to connect to your web host's database server then the server should be something other than local. Also, you said the support people's answer is "Mysql database ...". You are using SQL Server not MySQL, right?

-Mike

|||Thank you so much for your reply!

Yes it is Microsoft SQL Server I'm using. The web host gave us some choice when adding a new database, and I also added another database which is using MySQL Server, and it didn't work neither...

Sorry I'm new to ASP.net, so I don't know what should I put for "server" if I'm working with the web host's database server? I tried to give it the IP address of my web host, but it didn't work...

Would you please give me some further assistance on the code? Thank you!|||For your information, after I login to phpMyAdmin I get this welcome message:

MySQL 4.1.7 running on localhost:3306 as databaseadmin@.localhost

Don't know whether this helps...
I'll really appreciate if someone could help me with this problem, thank you in advance!!|||Problem solved!

I've added a new MySQL database, and connected to that database using Odbc connection. And it's now working!!

No comments:

Post a Comment