Solved

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

Posted on 2014-09-14
8
49 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
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Loop not working 29 47
coded character set iptc field within a jpeg 1 68
Problem to error 4 43
C#.NET and microsoft certification. 3 31
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…
Creating and Managing Databases with phpMyAdmin in cPanel.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 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

21 Experts available now in Live!

Get 1:1 Help Now