- 博客(11)
- 收藏
- 关注
原创 pg、mysql拉取表、表字段注释
--pg拉取表字段注释SELECTC.relname, col_description (A .attrelid, A .attnum) AS COMMENT, format_type (A .atttypid, A .atttypmod) AS TYPE, A .attname AS NAME, A .attnotnull AS NOTNULLFROM...
2019-06-28 10:51:58
606
原创 mysql 列出表列名,用逗号隔开
SELECT GROUP_CONCAT(COLUMN_NAME SEPARATOR ",") FROM information_schema.COLUMNSWHERE TABLE_SCHEMA = 'db_name' AND TABLE_NAME = 'table_name';
2019-06-25 16:30:25
1479
原创 表字段脱敏导出(随机字符串、随机数)
## 26个大小写字母,随机生成字符串create or replace function random_string(integer)returns text as$body$ select array_to_string(array(select substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv...
2019-06-25 11:06:25
1215
原创 pg_pathman安装、测试
1.下载$ git clone https://github.com/postgrespro/pg_pathman.git$ git branch -a$ git checkout PGPRO2.安装[root@localhost home]# export PATH=/home/postgres:$PATH[root@localhost home]# cd pg_pathman[...
2019-06-12 15:59:24
1069
原创 Oracle synonym(可解决无法单表授truncate权限)
场景:user_admin(DDL账号)user_ro(只读账号)创建两张表table1、table2,user_ro需要有这两张表的truncate权限,user_admin需要select、update权限因Oracle不可对单表授truncate权限,故table1、table2不能建在user_admin下解决方案:create table user_ro.tabl...
2019-05-31 16:48:56
1226
原创 mysqlbinlog查看
# 转换编码-base64-outputmysqlbinlog -vv --base64-output='DECODE-ROWS' --start-datetime="2019-05-14 9:51:01" mysql-bin.001233 | more#从2019-05-14 9:51:01 分开始查看mysqlbinlog -vv --start-datetime="2...
2019-05-15 17:59:54
207
原创 Linux安装postgresql-10.5及搭建从库
1.下载tar.gzhttps://www.postgresql.org/ftp/source/2.解压到/usr/local# tar -zxvf postgresql-10.5.tar.gz3.创建用户和组# groupadd postgres# useradd -g postgres postgres4.进行编译安装# cd postgresql-10.5...
2019-04-17 13:32:24
5515
原创 Linux安装mysql
1.检查Linux下是否安装过mysql#rpm -qa|grep -i mysql 检查是否安装mysql#rpm -e mysql-5.7.13-linux-glibc2.5-x86_64 --nodeps 强制卸载2.下载mysql安装包http://dev.mysql.com/downloads/mysql/这里我选择的是mysql-5.7.21-linux-gli...
2019-04-16 20:18:58
111
原创 mysql密码策略
mysql的密码策略通过插件的方式进行检查,插件的名称是validate_password,可通过如下方式安装:mysql> INSTALL PLUGIN validate_password SONAME 'validate_password.so';mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA...
2019-04-12 17:10:17
1844
原创 mysql创建用户并授权
createdatabasedb_xxx;createuseruser_xxx@'%' identifiedbypwd_xxx;grantallprivilegesondb_xxx.*touser_xxx@'%';createuseruser_xxx_admin@'%'identifiedbypwd_xxx;grant select,insert,upda...
2019-04-10 11:26:15
162
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人