mysql与Oracle update的区别
update :单表的更新不用说了,两者一样,主要说说多表的更新
Oracle> Oracle的多表更新要求比较严格,所以有的时候不是很好写,我们可以试试Oracle的游标
(游标参考:http://blog.csdn.net/lovelyhermione/archive/2009/08/18/4457500.aspx)
update (
select t.charger_id_ new_charger_id_
from t_cus_year_status t
left join t_customer_infos cus on cus.id_ = t.cus_id_
where....
) n set n.new_charger_id_ =6;
mysql>
update t_cus_year_status t
left join t_customer_infos cus on cus.id_ = t.cus_id_
set t.charger_id_ =6
where......;
相关文档:
首先需要卸载redhat自带的mysql数据库(不然安装时会出问题)
rpm -qa|grep mysql
然后 rpm -e 包名称
如果涉及到依赖,就先删除依赖,或者加个 -nodeps 参数忽略依赖
有网友说用yum -y remove mysql也可以
另一个解决方法时在linux自带mysql基础上再装新的mysql
二进制安装包版本很多,常用的就两个,我下的是 ......
如何提高mysql load
data
infile
的速度
测试数据2.5G,共有数据9427567条。用的mysql的large服务器的配置。
load
一次需要大概10分钟左右。
建的表用的是MYISAM,调整了几个session的参数值
SET SESSION BULK_INSERT_BUFFER_SIZE=256217728;
SET SESSION MYISAM_SORT_BUFFER_SIZE=256217728;
运行结果如下
Qu ......
1.登录MySQL终端 2.授权:
允许所有机器访问MySQL服务器
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH RIVILEGES;
允许指定机器访问MySQL服务器
GRANT ALL PRIVILEGES ON *.* TO 'root'@'IP地址'IDENTIFIED BY 'password' WITH GRANT OPTION; ......
最近别人在给我 sql 文件时简单的提了下 导入/导出 命令,在此基础上学习了下,总结到 myhere。
规定:
用户名:db_user
帐号: db_pass
数据库: db_name
表: table_name_1, table_name_2
说明: 一些操作需要有适当的权限。
1. ......
在表中已有大量的index的情况下插入大量数据,可以采用先将索引删除,然后再插入数据,然后再重新建立索引。之所以这样会快是因为???
7.2.14 Speed of INSERT Statements
The time to insert a record is determined by the following factors, where the numbers indicate approximate proportions:
& ......