1、mysql 导出文件:
SELECT `pe2e_user_to_company`.company_name, `pe2e_user_to_company`.company_code, `users`.name, `users`.uid, `users`.mail, `pe2e_email_notification_email`.`email_cc` FROM `users` , `pe2e_user_to_company` LEFT JOIN `pe2e_email_notification_email` ON `pe2e_user_to_company`.`uid` = `pe2e_email_notification_email`.`uid` WHERE `users`.`uid` = `pe2e_user_to_company`.`uid` into outfile '/tmp/users.csv' fields terminated by ',' enclosed by '"' lines terminated by '\r\n';
2、关联查询
sql中多个left join,为了保证返回数量和主表一样,要加个group by 主表id
3、if,ifnull,concat_ws等常见方法
1)concat_ws('',country, province, city) region 三字段按照''之间的内容合拼;
concat_ws('',CASE p.gameType1 WHEN 1 THEN '朗诵讲故事' WHEN 2 THEN '朗诵情景演讲' END,CASE p.gameType2 WHEN 3 THEN '主题写作' END) as gameType;
2)if(gender=1,'男','女') as gender;
3)ifnull(age,0) as age;
4)(CASE ageGroup WHEN 1 THEN '儿童A组' WHEN 2 THEN '儿童B组' WHEN 3 THEN '少年A组' WHEN 4 THEN '少年B组' END) as ageGroup;
4、mysql5.7 找回root密码
[root@166087 mysql]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --datadir=/data/mysql --skip-grant-tables mysql> update user set authentication_string=password('123456') where user='root';
5、阿里云使用笔记-MySQL远程连接-centos7
首先登录:
mysql -u root -h localhost -p
use mysql #打开mysql数据库
2)将host设置为%表示任何ip都能连接mysql,当然您也可以将host指定为某个ip
update user set host='%' where user='root' and host='localhost'; flush privileges; #刷新权限表,使配置生效
然后我们就能远程连接我们的mysql了。
3)如果您想关闭远程连接,恢复mysql的默认设置(只能本地连接),您可以通过以下步骤操作:
use mysql #打开mysql数据库 update user set host='localhost' where user='root'; #将host设置为localhost表示只能本地连接mysql flush privileges; #刷新权限表,使配置生效 update user set password=password('123456') where User='root';#修改密码 flush privileges ; #刷新权限表,使配置生效
备注:您也可以添加一个用户名为yuancheng,密码为123456,权限为%(表示任意ip都能连接)的远程连接用户。命令参考如下:
grant all on *.* to 'yuancheng'@'%' identified by '123456'; flush privileges;
4)mysql排序时如果该字段是varchar怎么办?
2种办法:
1. order by 字段+0
2. order by cast(字段 as int)
6、批量修改字段数据
update t_comment SET avatar = replace(avatar, 'http', 'https');//替换 update t_log set message=concat("https",message);//前面追加
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
- 群星《前途海量 电影原声专辑》[FLAC/分轨][227.78MB]
- 张信哲.1992-知道新曲与精丫巨石】【WAV+CUE】
- 王翠玲.1995-ANGEL【新艺宝】【WAV+CUE】
- 景冈山.1996-我的眼里只有你【大地唱片】【WAV+CUE】
- 群星《八戒 电影原声带》[320K/MP3][188.97MB]
- 群星《我的阿勒泰 影视原声带》[320K/MP3][139.47MB]
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[320K/MP3][148.91MB]
- 刘雅丽.2001-丽花皇后·EMI精选王【EMI百代】【FLAC分轨】
- 齐秦.1994-黄金十年1981-1990CHINA.TOUR.LIVE精丫上华】【WAV+CUE】
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]