S h o r t S t o r i e s

// Tales from software development

MySQL: stored procedure not found

with one comment

Some more MySQL weirdness while using the MySQL Connector/Net and MySQL 5.1…

If the ConnectionString doesn’t specify the database name with the correct casing then, even though the database can be successfully connected to, an attempt to execute a stored procedure in the database may fail with a MySqlException and the message:

Procedure or function '<procedure-name>' cannot be found in database '<database-name>'

 
As an example, my connection string was:

Database=Vitality;Data Source=server350;User Id=vuser;Password=vuser

 
When my application tried to execute a stored procedure a MySqlException was thrown with this message:

Procedure or function 'sp_hl7_get_data_item_mapping' cannot be found in database 'Vitality'.

 
I vaguely remembered a previous problem with database access that was resolved by changing the casing of the database name in the ConnectionString so that it exactly matched the casing of the database name as defined on the MySQL server. I checked the database name using MySQL Administrator and noted that it was all lowercase, i.e. ‘vitality’ rather than ‘Vitality’. So, I changed the ConnectionString to:

Database=vitality;Data Source=server350;User Id=vuser;Password=vuser

 
and I re-ran my application – it worked.

Advertisements

Written by Sea Monkey

October 14, 2010 at 8:00 pm

Posted in Debugging, Development

Tagged with ,

One Response

Subscribe to comments with RSS.

  1. really thanks. you saved my day.

    galdor

    September 20, 2016 at 10:37 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: