修改 Linux 上的 MySQL 的配置文件 /etc/my.cnf ,在[mysqld]下面添加一行配置,即 lower_case_table_names=1 ,然后 service mysqld restart 重启数据库。
2、有则更新无则插入
INSERT INTO T_USER(userid,name,sex) VALUES (id,username,usersex) ON DUPLICATE KEY UPDATE name=username,sex=usersex;
----
INSERT INTO bonus_card_info
(term_id,term_address,term_link_name,term_link_phone,term_card_id_card,term_card_no,term_card_name,band_code,point_type)
VALUE('0371011001','郑州市二七区','张三2','12312341234','410785410212355214','62226215421235','大傻','1','1')
ON DUPLICATE KEY UPDATE
term_address='郑州市二七区' ,term_link_name='张三2',term_link_phone='12312341234',
term_card_id_card='410785410212355214',term_card_no='62226215421235',term_card_name='大傻',
band_code='1',point_type='1'
注意:如果在Mysql中使用这种形式,则要求在数据表中userid字段必须是主键或建立了唯一的索引
3、----