by shigemk2

当面は技術的なことしか書かない

C-x C-q

describe-keyつかうとやっぱり便利だね

C-x C-q runs the command read-only-mode (found in global-map), which is an interactive compiled Lisp function in ‘simple.el’.

It is bound to C-x C-q.

(read-only-mode &optional ARG)

Change whether the current buffer is read-only. With prefix argument ARG, make the buffer read-only if ARG is positive, otherwise make it writable. If buffer is read-only and ‘view-read-only’ is non-nil, enter view mode.

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

  • mysql 5.7.19
  • ubuntu 17.04

5.7でrootを空パスワードにすると、ログインできなくなるのは、認証のプラグインのデフォルトでauth_socketなるものを使っているから。

mysql_native_passwordに変更するといいらしく。

ネイティブのパスワードハッシュ化方式を使用して、mysql.user テーブルと照合する認証が実装された

UPDATE user SET plugin='mysql_native_password' WHERE User='root';

なるほど。

journalctl f

tail -fと同等のことがjournalctl -fでもできるのはうれしい

$ cheat journalctl
# Actively follow log (like tail -f)
journalctl -f

# Display all errors since last boot
journalctl -b -p err

# Filter by time period
journalctl --since=2012-10-15 --until="2011-10-16 23:59:59"

# Show list of systemd units logged in journal
journalctl -F _SYSTEMD_UNIT

# Filter by specific unit
journalctl -u dbus

# Filter by executable name
journalctl /usr/bin/dbus-daemon

# Filter by PID
journalctl _PID=123

# Filter by Command, e.g., sshd
journalctl _COMM=sshd

# Filter by Command and time period
journalctl _COMM=crond --since '10:00' --until '11:00'

# List all available boots 
journalctl --list-boots

# Filter by specific User ID e.g., user id 1000 
journalctl _UID=1000