./sshd sshd re-exec requires execution with an absolute path
输入全路径执行命令,继续出现错误,如下:
1 2 3 4 5
/usr/sbin/sshd Could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_ecdsa_key Could not load host key: /etc/ssh/ssh_host_ed25519_key sshd: no hostkeys available -- exiting.
执行sshd-keygen命令解决上述问题
1 2 3 4
/usr/sbin/sshd-keygen Generating SSH2 RSA host key: [ OK ] Generating SSH2 ECDSA host key: [ OK ] Generating SSH2 ED25519 host key: [ OK ]
给root生成一个密码
1 2 3 4 5 6
passwd root Changing password for user root. New password: BAD PASSWORD: The password is shorter than 8 characters Retype new password: passwd: all authentication tokens updated successfully.
ssh root@localhost root@localhost's password: Last failed login: Sun Sep 29 09:16:59 UTC 2019 from localhost on ssh:notty There were 3 failed login attempts since the last successful login. Connection to localhost closed.
会遇到连不上去的问题,这时,需要修改/etc/ssh/sshd_config配置。
把里面的UsePAM yes改为UsePAM no
杀掉之前sshd进程后,再次启动
1 2
/usr/sbin/sshd WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several problems.
这时就可以成功登录了。
1 2 3
root@localhost root@localhost's password: Last login: Sun Sep 29 09:20:41 2019 from localhost
生成一个新的镜像
退出容器,并查看容器id
1 2 3
docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ca6a84a514c2 centos "bash" 34 minutes ago Exited (255) 11 seconds ago musing_goodall
pip安装依赖的时候报错,pg_config executable not found, 所以需要在mac上安装postgresql。
1
brew install postgresql
如果出现Updating Homebrew并且卡住了,请参考
安装过程中,有可能会遇到操作文件权限不够的情况,添加一下权限就可以了。
安装成功,将有如下提示:
1 2 3 4 5 6 7 8 9 10 11
To migrate existing data from a previous major version of PostgreSQL run: brew postgresql-upgrade-database
To have launchd start postgresql now and restart at login: brew services start postgresql Or, if you don't want/need a background service you can just run: pg_ctl -D /usr/local/var/postgres start ==> Summary 🍺 /usr/local/Cellar/postgresql/11.5_1: 3,189 files, 35.6MB ==> `brew cleanup` has not been run in 30 days, running now... Pruned 4 symbolic links and 58 directories from /usr/local
DELIMITER // DROPPROCEDUREIFEXISTS batchInsert; CREATEPROCEDURE batchInsert(n INT) BEGIN DECLARE i INT; SET i = 0; WHILE i < n DO INSERTINTO score(name, class, score) VALUES (substring(MD5(RAND()), 1, 10), CONCAT('G', ROUND(RAND() * 9)), ROUND(RAND() * 100)); SET i = i + 1; ENDWHILE; END // DELIMITER ; CALL batchInsert(50);
TOP N
HAVING子句中的< 3表示取前两条。
1 2 3 4 5
SELECT s1.class, s1.score FROM score s1 LEFTJOIN score s2 ON s1.class = s2.class AND s1.score <= s2.score GROUPBY s1.class, s1.score HAVINGCOUNT(1) < 3 ORDERBY s1.class, s1.score DESC;