随笔分类 -  Mysql

摘要:网摘DELIMITER $$CREATE DEFINER=`root`@`%` PROCEDURE `sp_pament_TrainFee`()BEGIN/*局部变量的定义 declare*/declare strYear int;declare strEnrollID int;declare feesum int;declare stop int default 0;declare cur cursor for(select year ,EnrollID ,sum(Fee) from trainmanage where ReturnStatus !=1 group by Year,Enr.. 阅读全文
posted @ 2014-03-05 17:29 偶不是大叔 阅读(27066) 评论(0) 推荐(1)
摘要:1.FIND_IN_SET 获取某个字符串在另一个以‘,’隔开的字符串中的位置使用示例:select FIND_IN_SET('198', '198,23') 返回值:12.group_concat 将某列的数据组合成字符串表employeeID Name120 小刘119 小张使用示例:select group_concat(Name) from employee where id in (120,119) 返回值为:小张,小刘 阅读全文
posted @ 2014-02-27 16:42 偶不是大叔 阅读(245) 评论(0) 推荐(0)
摘要:网摘ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL server解决方法:1。 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"mysql -u root -pvmwaremysql>use my 阅读全文
posted @ 2014-01-17 10:29 偶不是大叔 阅读(195) 评论(0) 推荐(0)
摘要:执行下面的sqlSET SQL_SAFE_UPDATES=0 阅读全文
posted @ 2014-01-10 13:48 偶不是大叔 阅读(506) 评论(0) 推荐(0)
摘要:如何备份MySql的数据库应该说一般的数据库都有BackUp的需求, MySql备份数据库的方式很简单, 但是在网上说得云里雾里, 也应该是我对MySql数据库不熟悉.目标(Target) : 将本机中的mysql数据库备份到本机中的mydatabase数据库中 - 也就是完全的Copy一个数据库.#1. C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqldump -u root -p mysql>backup_database.sqlEnter password: ******** (你的root帐户的密码)完成以后, 在路径C:\ 阅读全文
posted @ 2013-08-06 14:03 偶不是大叔 阅读(240) 评论(0) 推荐(0)
摘要:使用into的方法(单个赋值)select id into @id from tbl_currentWeather where cityid = _cityid;多个赋值select @id:=id,@cityid:=cityid from tbl_currentWeather where cityid = _cityid; 阅读全文
posted @ 2013-08-06 11:25 偶不是大叔 阅读(19821) 评论(0) 推荐(0)
摘要:windows系统下,参照网上的方法解决方案:步骤1:执行sqlset global wait_timeout=28800;set global interactive_timeout=28800;set global net_read_timeout=28800;set global net_wr... 阅读全文
posted @ 2013-06-05 18:22 偶不是大叔 阅读(3813) 评论(0) 推荐(0)