Tag: MySQL

MySQL Select Columns Quirk

A long time ago I came across a quirk with MySQL that would not let you select all columns in a query  if you first specify a column name.  So executing the following SQL:

select post_title, * from posts;

Read More »

Posted in Programming | Tagged | Leave a comment

Preserve Comments in MySQL Stored Procedures

Comments in any code are good practice and can help guide yourself and others through more complicated processes.

Single and multi-line comments can be included in MySQL stored procedures using the following syntax:

# a single-line comment

select 1;

/* a
   multi-line
   comment
*/

When creating stored procedures for a MySQL database using a GUI, like MySQL Browser, any comments added are preserved (as you would expect). However, if you use the command line client you may have noticed that comments are stripped out. The command line client removes any comments before executing the script so comments are lost. Read More »

Posted in Programming | Tagged | 2 Comments

List MySQL Stored Procedures

When using stored procedures with MySQL you may at some point want to get a list of all the stored procedures that exist in your database. Using the MySQL INFORMATION_SCHEMA  database and the ROUTINES table we can easily list information about procedures or functions. Read More »

Posted in Programming | Tagged | 1 Comment

Connecting to MySQL Server Across a Local Windows Network

To access MySQL Server over a local Windows network you will need to open up the port that MySQL is using and also grant privileges for the user that will access the database server.

Read More »

Posted in Programming | Also tagged | 20 Comments

mysql.data Incorrect number of arguments for PROCEDURE

The following error occurred while using the MySQL Connector for ASP.NET:

mysql.data Incorrect number of arguments for PROCEDURE 'stored procedure name' expected 3 got 2

Read More »

Posted in Programming | Also tagged , | Leave a comment