Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 62
  • Last Modified:

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

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
thinklings
Asked:
thinklings
  • 6
  • 2
1 Solution
 
mankowitzCommented:
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
 
thinklingsAuthor Commented:
Thanks, I have contacted my hosting provider to see if there is anything they can sort out on their end.
0
 
thinklingsAuthor Commented:
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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
thinklingsAuthor Commented:
How do I check if authentication is handled within my code?
0
 
thinklingsAuthor Commented:
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
 
mankowitzCommented:
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
 
thinklingsAuthor Commented:
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
 
thinklingsAuthor Commented:
No proper solution here. Just worked after a rebuild.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now