学之道 http://85g.net/blog/ 2023-12-05 学之道 86 windows下载安装mariadb5.5.68绿色版 下载地址:

https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-5.5.68/winx64-packages/mariadb-5.5.68-winx64.zip

解压安装文件

创建服务

D:mariadb-5.5.68-winx64mysqld.exe --install mariadb-5.5.68 --defaults-file="D:mariadb-5.5.68-winx64my-small.ini"

删除服务

D:mariadb-5.5.68-winx64mysqld.exe --remove mariadb-5.5.68 --defaults-file="D:mariadb-5.5.68-winx64my-small.ini"

初始化数据库

D:mariadb-5.5.68-winx64mysql_install_db.exe --datadir=d:data --password=123456


]]>
学之道 2020-06-22 09:06:22
85 sqlite group_concat group_concat(x[,y])

该函数返回一个字符串,该字符串将会连接所有非NULL的x值。该函数的y参数将作为每个x值之间的分隔符,如果在调用时忽略该参数,在连接时将使用缺省分隔符","。再有就是各个字符串之间的连接顺序是不确定的。

示例

select id,group_concat(tag) from tablename group by id

]]>
学之道 2020-06-19 20:06:15
84 postgresql permission denied for schema GRANT ALL PRIVILEGES ON SCHEMA xxx TO yyy;

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA xxx TO yyy;

]]>
学之道 2018-03-19 12:03:28
83 linux更改时区 # cat  /etc/sysconfig/clock
ZONE="Asia/Shanghai"

UTC=true            

# rm   -f /etc/localtime 
# ln -sf  /usr/share/zoneinfo/Asia/Shanghai    /etc/localtime              

linux是依据/etc/localtime文件内容知道目前系统的时区信息,这个文件一般是从/usr/share/zoneinfo/面选择适当的时区复制过来就可以使用

重启机器后就可以看到时区更改

]]>
学之道 2018-02-22 11:02:21
82 ssh私钥登陆提示Server refused our key问的解决办法 问题现象:

在开启Selinux的情况下,使用无密码认证的私钥登陆登陆时,会出现如下错误提示:

Server refused our key

在/var/log/audit/audit.log日志文件下,可以看到如下提示:

type=AVC msg=audit(1371453190.650:21382): avc: denied { read } for pid=2048 comm="sshd" name="authorized_keys" dev=dm-2 ino=393229 scontext=unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:home_root_t:s0 tclass=file

问题原因:

生成的~/.ssh/authorized_keys 文件没有selinux上下文属性,导致无法通过Selinux认证,查看该文件属性如下:

[barlowliu@web1 ~]$ ll -Z .ssh/authorized_keys
-rwxr--r--. barlowliu barlowliu ? .ssh/authorized_keys

很多网友在遇到此问题时,都是采用的关闭selinux方式解决问题,但鉴于selinux带来的安全性加强,在一般情况下,不建议关闭selinux。

办法解决:

# restorecon -R -v /home

该命令的作用了恢复/home 目录下所有文件的默认selinux安全上下文属性。

再次查看~/.ssh/authorized_keys文件的selinux安全上下文属性,发现已经改变:

[barlowliu@web1 ~]$ ll -Z ~/.ssh/authorized_keys
-rwxr--r--. barlowliu barlowliu unconfined_u:object_r:user_home_t:s0 /home/barlowliu/.ssh/authorized_keys

]]>
学之道 2017-10-10 12:10:09
81 cpio使用方法 cpio解压文件 test

先在test当前目录下创建文件夹test_dir

cd test_dir

cpio -i -F ../test

解压完成


cpio压缩文件夹test_dir

cd test_dir

find . | cpio -o -H newc > ../test

压缩完成 

]]>
学之道 2017-06-29 11:06:25