Category Archives: MySQL

Connecting to MySQL :: MySQL Query Browser :: MySQL error number 1130

Problem:

Couldn’t connect to MySQL on TGIIS from TGSQL

Solution:

Try this command (after logging into mysql with root)

GRANT ALL PRIVILEGES ON *.* TO ‘myaccount’@’%’ IDENTIFIED BY ‘some_pass’ WITH GRANT OPTION;

where myaccount is any new account you want to create.

Note the hostname is ‘%’ which gives blanket permission to allow logging in FROM anywhere.

Creating a Stored Procedure – MySQL 5.0

DELIMITER$$
   CREATE PROCEDURE testing(IN ID INT)
     BEGIN
        SELECT COUNT(*) AS numrows FROM clients.clients_domain;
     END$$
DELIMITER;

The “DELIMITER $$” statement causes MySQL to use two dollar signs ($$) as it’s end-of-line delimiter, instead of a semi-colon (;). This will allow any SQL between the BEGIN and END to have a semi-colon at the end of the line, without causing MySQL to think the query is done. The END statement needs the two dollar signs after it so MySQL knows the query is done and ready to be executed.