随笔分类 -  MYSQL

摘要:"https://canbefree.github.io/" 阅读全文
posted @ 2016-11-01 10:55 UCanBeFree 阅读(132) 评论(0) 推荐(0)
摘要:union与union all union会去除重复数据,一般使用union all 阅读全文
posted @ 2016-01-18 09:40 UCanBeFree 阅读(97) 评论(0) 推荐(0)
摘要:三台服务器:大体不说了,请参考网址:http://www.cnblogs.com/gaizai/archive/2012/11/21/2780816.htmlsudo mysql-proxy \--proxy-read-only-backend-addresses=192.168.13.220:33... 阅读全文
posted @ 2014-12-11 19:23 UCanBeFree 阅读(159) 评论(0) 推荐(0)
摘要:批量执行:update `erp_orders` set `orders_shipping_code`='RL007169726CN' where `erp_orders_id`=1055614141 and orders_shipping_code='';update `erp_orders` s... 阅读全文
posted @ 2014-07-25 12:41 UCanBeFree 阅读(226) 评论(0) 推荐(0)
摘要:世纪惨案:导入EXCEL出现:表头为 erp_orders_id;UPDATE `erp_orders` SET orders_ship_fee='', `orders_shipping_code`='' WHERE erp_orders_id=erp_orders_id;全部追踪号全没了。 阅读全文
posted @ 2014-07-23 15:59 UCanBeFree 阅读(403) 评论(0) 推荐(0)
摘要:error1:ERROR 1045 (28000): Access denied for user 'root'@'xyt.local' (using password: YES)grant all on mysql.* to 'root'@'192.168.11.172' identified b... 阅读全文
posted @ 2014-07-19 17:12 UCanBeFree 阅读(156) 评论(0) 推荐(0)
摘要:游标: 类似于数组的下标。declare cur_test CURSOR for select id ,username from erp_manages; 定义游标;declare continue handler FOR SQLSTATE '02000' set done=1; 当数据扫描到... 阅读全文
posted @ 2014-07-08 17:38 UCanBeFree 阅读(265) 评论(0) 推荐(0)
摘要:比较下面两个SQL语句: select *from erp_purchase A join erp_purchasedetails B on A.id=B.id; ( 77,335 总计, 查询花费 0.0013 秒) select *from erp_purchase A join (s... 阅读全文
posted @ 2014-06-09 19:12 UCanBeFree 阅读(416) 评论(0) 推荐(0)
摘要:分布式设计主要步骤:1,需求分析 (数据库主要需要实现的功能)2,概念设计(画E-R图,编写数据字典)(数据字典一般包括:数据项、数据结构、数据存储、数据流和数据处理 见最底端)3,逻辑设计 (设计表间关系,) 1)全局逻辑设计。 2)分布设计 3)局部逻辑设计 4,局部物理设计DEMO ... 阅读全文
posted @ 2014-05-28 17:25 UCanBeFree 阅读(468) 评论(0) 推荐(0)
摘要:SELECT case 1 when 1 then "one" when 2 then "two" end;SELECT IF(1,"男","女") 阅读全文
posted @ 2014-05-21 18:02 UCanBeFree 阅读(101) 评论(0) 推荐(0)
摘要:创建存储过程:1 delimiter //2 create procedure printname (id int,out name char(50) )3 begin4 select user into name from user where id=id;5 end6 //7 delimiter... 阅读全文
posted @ 2014-05-21 18:01 UCanBeFree 阅读(159) 评论(0) 推荐(0)
摘要:1,游客权限:用root 创建用户:insert into mysql.user(host,user,password)value('localhost','visit',password('123456'));登录重启mysql.mysql -uvisit -p123456登录成功执行命令:cr... 阅读全文
posted @ 2014-05-21 15:54 UCanBeFree 阅读(161) 评论(0) 推荐(0)
摘要:如何创建存储过程: 1 DELIMITER // 2 create procedure func1()3 begin4 select *from A;5 end6 //7 DELIMITER ; View CodeDELIMITER是分割符的意思,因为MySQL默认以";"为分隔符,如果我们没有声... 阅读全文
posted @ 2014-05-13 20:19 UCanBeFree 阅读(162) 评论(0) 推荐(0)
摘要:在mysql命令加上选项-U后,当发出没有WHERE或LIMIT关键字的UPDATE或DELETE时,mysql程序就会拒绝执行 阅读全文
posted @ 2014-05-13 17:00 UCanBeFree 阅读(291) 评论(0) 推荐(0)
摘要://这句在php中可以用header("content-Type: text/html; charset=utf-8");set names gb2312;注意网页和数据库gbk2312的不一样的地方set name gb2312;往table插入中文发现 显示出来的是乱码。解决办法:在所有执行mysql_query函数做数据库插入删除查询之前 执行下面三个命令:mysql_query('set character_set_client = utf8');mysql_query('set character_set_connection = GBK& 阅读全文
posted @ 2014-04-08 14:47 UCanBeFree 阅读(141) 评论(0) 推荐(0)
摘要:看了很多文档还是一头雾水。mysql在4.1后就支持多语言。+--------------------------+----------------------------+| Variable_name | Value |+--------------------------+----------------------------+| character_set_client | utf8 || character_set_connection | utf8 ... 阅读全文
posted @ 2014-04-08 10:05 UCanBeFree 阅读(285) 评论(0) 推荐(0)
摘要:in 和exists的用法差不多.但是in条件不能有外部条件,如:select *from rp_001 A where exists (select years from RepOrt B where A.repid=20)select *From rp_001 A join RepOrt on A.repid=20;exists 不会筛选出report的数据而join会与report自然连接。 阅读全文
posted @ 2014-01-09 16:49 UCanBeFree 阅读(303) 评论(0) 推荐(0)