Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 22nd, 2007, 04:11 PM
Registered User
 
Join Date: May 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default MySQL "Select Denied to user" Problem

Hi All,

I am setting up an ASP.net 2.0 website with a MySql 4.1 backend. I am using the ODBC 3.51 to connect to it.

The website has a mix of coded DB retrieval functions in VB.net and binded controls. This all works fine in the development server at home, but I recently tried putting it on a live server hosted by GoDaddy. Any vb.net code DB access works fine, but the bound controls comes back with

"ERROR [HYT00] [MySQL][ODBC 3.51 Driver][mysqld-4.1.22-max-log]SELECT command denied to user 'admin'@'server' for table 'regions' "

I can use this account in code and see that table, but not in a bound combo box. I have emailed GoDaddy but they can't provide coding support.

They offer 2 help info sheets

http://help.godaddy.com/article.php?...3&topic_id=102
http://help.godaddy.com/article.php?...0&topic_id=102

If I try the DSN it does the same thing.

Any help would be appreciated.

Regards

DJIDave

 
Old May 23rd, 2007, 08:33 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Look a the error again:

"ERROR [HYT00] [MySQL][ODBC 3.51 Driver][mysqld-4.1.22-max-log]SELECT command denied to user 'admin'@'server' for table 'regions' "

This would indicate to me that you are connecting to the database just fine, but the db permissions are denying the user select access to the table, as the error describes. You need to set the right permissions on the tables for the user you'll be connecting as.

-Peter
 
Old May 23rd, 2007, 08:42 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Peter is quite right, void of your application if you logged into the server through, say Query Browser, you would get the same error.

To correct this, you should log into MySQL Administrator as root (or any other power user who has the ability to change user rights) goto the user administration and select your admin user, view there permissions, and then grant them permissions to the entire database you are trying to select from.

(This can also be done through a MySQL shell, but I can't quite remember the commands to change user rights through the shell)

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old May 25th, 2007, 04:49 PM
Registered User
 
Join Date: May 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The issue is that the user has the correct rights. I can use that user and connect in vb.net code that is behind the asp page, using the odbc connection class and everything works fine. It is just bound controls that fail with this error. I can log in to PHPmyAdmin with the user name and it can see everything ok (this is the main admin account of the database).

It is only combo boxes and dataviews which have been bound using a sqldatasource which don't work. I have tested the SQL that is in them and it works in code and in the admin screen.

Thanks in advance

DJIDave

 
Old May 25th, 2007, 04:53 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Show me your code, this doesn't make sense.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old May 29th, 2007, 03:06 PM
Registered User
 
Join Date: May 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I traced the problem down thanks to yourself. The designer was showing the tables as tablenamewhereas in the code it was database.tablename and the database name had changed.

Thanks for your help

DJIDave






Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL said: select command denied to user: 'root@ surendran MySQL 2 September 9th, 2010 12:27 AM
MySQL "Select Denied to user" Problem djidave ASP.NET 2.0 Professional 2 May 25th, 2007 04:38 PM
SELECT permission denied on object 'Shippers' imtiaz_786 ASP.NET 1.0 and 1.1 Basics 1 September 18th, 2006 12:24 PM
Mysql access denied pratheeba Java GUI 1 November 20th, 2003 05:39 AM
MySQL 4.0.14 Access Denied remotely ! wireblock MySQL 1 September 25th, 2003 11:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.