如果你像我一樣,樹莓派並不是固定一個地方。
會拿來拿去的移動,這樣樹莓派的 wifi 或 IP 就是常態性變動的。
也許會在 ssh 登入時遇到這個問題
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! ...(中間略)... Host key verification failed.
找找 /Users/<user>/.ssh/known_hosts 這個檔案。
看看有沒有一個 IP 相同的記錄,刪除存檔,再重新登上去就可以了。
順便記得看一下樹莓派常用的幾個 IP 是不是相同的 hash code
Enter current password for root (enter for none) Switch to unix_socket authentication [Y/n] Change the root password? [Y/n] Remove anonymous users? [Y/n] Disallow root login remotely? [Y/n] Remove test database and access to it? [Y/n] Reload privilege tables now? [Y/n]
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB installation should now be secure.
Thanks for using MariaDB!
測試是否安裝成功
$ sudo mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 131 Server version: 10.3.22-MariaDB-0+deb10u1 Raspbian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
$ mysql -u rasp -p --host='127.0.0.1' --port=3306 testdb Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 135 Server version: 10.3.22-MariaDB-0+deb10u1 Raspbian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.