Error happens when My application uploads to server

Posted by Amritha444 under Sql Server on 1/13/2011 | Points: 10 | Views : 1253 | Status : [Member] | Replies : 4
hi all

I purchase server space and upload my application to it.Database (iam using MySQL ) also.Its working fine but when taking some pages error like this appearing which works well i n my local system.
Error is
MySql.Data.MySqlClient.MySqlException: SELECT command denied to user 'mydbname'@'122.172.119.128' for table 'employeedetails'
at MySql.Data.MySqlClient.MySqlStream.OpenPacket()
at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId)
at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet()
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at dboperation.GetDataTable(String qry) in c:\myapps\App_Code\dboperation.cs:line 101}


Thanks in advance




Responses

Posted by: SheoNarayan on: 1/13/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Hi Amritha,

As the error suggested it doesn't have permission to use the SELECT operation on the mentioned table. Go to your MySql user administration and give SELECT permission to "mydbname" user and your page should work fine.
SELECT command denied to user 'mydbname'@'122.172.119.128' for table 'employeedetails'

Thanks


Regards,
Sheo Narayan
http://www.dotnetfunda.com

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/13/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

You need to have the GRANT, Execute, Select permissions to the server i guess... Check with the webspace providers for these access...

Thanks
Karthik
www.f5Debug.net

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: PandianS on: 1/13/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi

In-case of SQL Server, You have to the following statement

Login into the Server(122.172.119.128) and give the SELECT permission as given below
USE <DatabaseName>

GO
GRANT SELECT ON employeedetails TO mydbname
GO
Cheers
www.sqlserverbuddy.blogspot.com

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Suresh.mekkattil on: 1/13/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,
I mysql, you need to provide your IP inorder to acess the db

-----
Suresh M

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response