Solved

SELECT command denied to user 'web215-crm'@'10.0.29.64' for table 'parentinventory'

Posted on 2014-09-14
8
47 Views
Last Modified: 2015-09-19
Hi,

I am getting the following error with a SELECT statement on a shared hosting server.

SELECT command denied to user 'web215-crm'@'10.0.29.64' for table 'parentinventory'

It was working but not sure what has changed to affect it now or if it is on the hosting server end.
0
Comment
Question by:thinklings
  • 6
  • 2
8 Comments
 
LVL 24

Expert Comment

by:mankowitz
ID: 40321982
I don't know how much of the database you really have access to. MySQL provides table and command level access prohibitions. Can you get to a MySQL console? If so, you are ultimately going to want to issue a command like this

GRANT SELECT  ON `parentinventory` to `web215-crm`@`10.0.29.64`

However, I suspect you won't have the GRANT privilege, and you will probably have to talk to your hosting company about that.
0
 

Author Comment

by:thinklings
ID: 40321988
Thanks, I have contacted my hosting provider to see if there is anything they can sort out on their end.
0
 

Author Comment

by:thinklings
ID: 40322265
I got the following response from my hosting provider -

Thank you for your patience, we had a closer look at this. The issue isn't to do with permissions, currently database web215-crm has the following permissions:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `web215-crm`.* TO 'web215-crm'@'%' WITH GRANT OPTION

Select is in there as you can see, it could in relation to a script issue. It could to do with authentication is handled in your code when query is run for the user?
0
 

Author Comment

by:thinklings
ID: 40322266
How do I check if authentication is handled within my code?
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:thinklings
ID: 40322267
This is an example of a query that I am running -

SQLString = "SELECT idCompanies FROM `web215-crm`.Companies WHERE trim(CompanyName) = '" & Trim(ASPxComboBoxCompany.Text) & "'"

Open in new window


And this is the connection string I am using -

<connectionStrings>
    <add name="CJG" connectionString="User Id=web215-crm;server=79.170.44.215;Persist Security Info=True;database=web215-crm;pwd=XXXXXXX;convert zero datetime=True" providerName="MySql.Data.MySqlClient" />
  </connectionStrings>

Open in new window

0
 
LVL 24

Expert Comment

by:mankowitz
ID: 40322815
Sometimes, you can get that error if you reference a table that doesn't exist or if you inadvertently connect to the wrong server. Can you confirm that
1. The server is 79.170.44.215
2. There is a table "Companies" in schema web215-crm

try replacing your select statement with something very basic to see if it works.

SQLString = "SELECT idCompanies FROM `web215-crm`.Companies WHERE 1"

Also, as a note for later, be very careful of including user input in an SQL query. You should either escape ASPxComboBoxCompany.Text or use a parameterized query.
0
 

Accepted Solution

by:
thinklings earned 0 total points
ID: 40322897
Thanks mankowitz.. All references were correct so I just rebuilt the software with the same code and all is working now. Not sure what the problem was or what was fixed but it is operating now.

Thanks again for your help.
0
 

Author Closing Comment

by:thinklings
ID: 40984552
No proper solution here. Just worked after a rebuild.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now