Mysql´æ´¢¹ý³Ì£¨ËÄ£©——Òì³£´¦Àí
ÓÐʱºò£¬²»Ï£Íû´æ´¢¹ý³ÌÅ׳ö´íÎóÖÐÖ¹Ö´ÐУ¬¶øÊÇÏ£Íû·µ»ØÒ»¸ö´íÎóÂë¡£
Mysql
Ö§³ÖÒì³£´¦Àí£¬Í¨¹ý¶¨Òå
CONTINUE/EXIT
Òì³£´¦ÀíµÄ
HANDLER
À´²¶»ñ
SQLWARNING/NOT FOUND/SQLEXCEPTION
£¨¾¯¸æ
/
ÎÞÊý¾Ý
/
ÆäËûÒì³££©¡£ÆäÖУ¬
FOR
ºóÃæ¿ÉÒÔ¸ÄΪ
SQLWARNING,
NOT FOUND, SQLEXCEPTION
À´Ö¸Ê¾ËùÓÐÒì³£¶¼´¦Àí£¬Ï൱ÓÚ
oracle
ÖеÄ
others
¡£ÀýÈ磬µ±²»½øÐÐÒì³£´¦Àíʱ£¬ÒÔÏ´úÂ뽫ֱ½ÓÅ׳öÒ»¸ö
ERROR 1062 (23000)
´íÎó£º
Sql
code 4-1:
CREATE PROCEDURE test_proc_ins1(
IN i_id INT,
IN i_name VARCHAR(100)
)
BEGIN
INSERT INTO testproc VALUES (i_id,i_name);
INSERT INTO testproc VALUES (i_id,i_name);
END;
¾¹ýÒì³£´¦Àíºó£¬¿ÉÒÔ±ÜÃâÅ׳ö´íÎ󣬶øÊǶ¨ÒåÒ»¸ö·µ»Ø²ÎÊý
o_ret
¸³ÓèÌØÊâÖµÀ´±íʾʧ°Ü£¬ÕâÑù£¬ÔÚ
java
´úÂëÖУ¬¿ÉÒÔͨ¹ý»ñÈ¡·µ»ØÖµ¶ø²»ÊDz¶»ñÒì³£µÄ·½Ê½À´´¦ÀíÒµÎñÂß¼¡£ÀýÈ罫·µ»ØÖµÉèÖÃΪ
-1:
Sql
code 4-2:
CREATE PROCEDURE test_proc_ins1(
IN i_id INT,
IN i_name VARCHAR(100),
OUT o_ret INT)
BEGIN
DECLARE EXIT HANDLER FOR SQLSTATE '23000' set o_ret = -1;
-- Ò²¿ÉÒÔÕâÑùʹÓãº
-- DECLARE EXIT HANDLER FOR SQLWARNING,NOT FOUND,SQLEXCEPTION set o_ret=-1;
INSERT INTO testproc VALUES (i_id,i_name);
INSERT INTO testproc VALUES (i_id,i_name);
set o_ret = 1;
END;
Ïà¹ØÎĵµ£º
±¾ÎĽéÉÜÁËÊý¾Ý¿âË÷Òý£¬¼°ÆäÓÅ¡¢È±µã¡£Õë¶ÔMySQLË÷ÒýµÄÌص㡢ӦÓýøÐÐÁËÏêϸµÄÃèÊö¡£·ÖÎöÁËÈçºÎ±ÜÃâMySQLÎÞ·¨Ê¹Óã¬ÈçºÎʹÓÃEXPLAIN·ÖÎö²éѯÓï¾ä£¬ÈçºÎÓÅ»¯MySQLË÷ÒýµÄÓ¦Óᣱ¾ÎÄÕª×Ô¡¶MySQL 5ȨÍþÖ¸ÄÏ¡·(3rd)µÄ8.9½Ú¡£(2007.07.05×îºó¸üÐÂ)
Ë÷ÒýÊÇÒ»ÖÖÌØÊâµÄÎļþ(InnoDBÊý¾Ý±íÉϵÄË÷ÒýÊDZí¿Õ¼äµÄÒ»¸ö× ......
½üÈÕ£¬ÓÐÒ»¸öÏîÄ¿ÐèҪͨ¹ýOAϵͳ£¨Dominoƽ̨£©ÏòÒ»¸öMySQLÓ¦ÓòåÈë¼Ç¼£¬ÒòΪƽ̨ÊÇwindowsƽ̨£¬ËùÒÔ²ÉÓÃÁËODBCÁ¬½Ó·½Ê½£¬ÔÚOA·þÎñÆ÷ÉÏ°²×°ÁËMyODBC-3.51.11-1Çý¶¯£¬ÅäÖÃÁËODBCÇý¶¯Êý¾ÝÔ´Ö®ºó£¬²åÈë¼Ç¼³É¹¦£¬µ«²»ÂÛÊDzåÈëÖÐÎÄÄÚÈÝ£¬»¹ÊÇ´ÓMySQLÖжÁÈ¡ÖÐÎÄÄÚÈÝ£¬¶¼ÊÇÂÒÂ룬ÔÚÍøÉϲéÔÄÁ˸÷ÖÖ×ÊÁÏ£¬³õ²½ ......
½ñÌì¸øÐÂÀ´µÄÔ±¹¤Á¬½ÓÊý¾Ý¿â£¬ÐÞ¸ÄÁËÒ»ÏÂmysql rootÓû§µÄÃÜÂ룬ÎÒÏÂÔصÄÊÇ´ò°üµÄredMine£¬Ä¬ÈÏÃÜÂëÊÇ¿Õ£¬ÐÞ¸ÄÃÜÂëÖ®ºóÖØÆôredmine£¬phpAdmin Á´½Ó²»ÉÏmysqlÊý¾Ý¿âÁË£¬ÎÒÒ²ÐÞ¸ÄÁËphpadminÎļþ¼ÐϵÄconfig.inc.phpµÄÃÜÂ룬»¹ÊDz»ÐУ¬Ìáʾ#1130 - Host 'localhost' is not allowed to connect to this MySQL server´íÎó£¬Ã÷ ......
Ò»¡¢Á¬½ÓMYSQL
¡¡¡¡¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë
¡¡¡¡1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
¡¡¡¡Ê×ÏÈÔÚ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼ mysqlbin£¬ÔÙ¼üÈëÃüÁîmysql -uroot -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂ룬Èç¹û¸Õ°²×°ºÃMYSQL£¬³¬¼¶Óû§rootÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½MYSQLÖÐÁË£¬MYSQLµÄÌáʾ·ûÊÇ£ºmysql>
¡¡¡ ......
±àÒëÇ°ÐèÒª°²×°µÄ¿â£º
g++
libmysqlclient15-dev
libglade2-dev
libglib2.0-dev
libgtkmm-2.4-dev
libpcre3-dev
libxml2-dev
È»ºóÖ´ÐÐ
cd mysql-gui-common
./configure
make
sudo make install
cd ../mysql-administrator
./configure
make
sudo make install
°²×°MySQL Administrator
°²×°Íê³Éºómysql- ......