樹莓派 mysql 安裝

2022-08-22 04:06:12 字數 1109 閱讀 5765

linux

mysql

yesterday is a history, tomorrow is a mystery, but today is a gift.

mysql 在樹莓派 raspberry pi 上的安裝和在 linux 上的差不多,因為網上的教程只是記述了一部分且遇到了情況,就整理下來

sudo apt-get update

sudo apt-get install mysql-server
接下來就是安裝過程了,本來以為中間會提示輸入密碼,結果一口氣就安裝完了,想到該怎麼登陸啊

sudo mysql -u root

welcome to the mariadb monitor.  commands end with ; or \g.

your mariadb connection id is 6

server version: 10.1.23-mariadb-9+deb9u1 raspbian 9.0

type 'help;' or '\h' for help. type '\c' to clear the current input statement.

mariadb [(none)]>

:遇到陌生的 mariadb,百科了發現是 mysql 的乙個分支,完全繼承 mysql 的用法,所以也不擔心了,不過,這個應該是看個人情況的

#

資料庫中使用

#連線資料庫

use mysql;

#修改密碼為123456,自己定

update user set password=password('123456') where user='root';#重新整理

flush privileges;#退出

exit;

sudo /etc/init.d/mysql status/start/stop/restart
安裝之後需要修改密碼,不然密碼為空

樹莓派 無法安裝mysql 樹莓派安裝mysql

前置,更新系統 sudo apt get update sudo apt get upgrade 安裝與配置mysql 因為系統版本不同所以我們要根據自己的系統版本來換相應的源 更換源時,必須先將原來的源複製乙份 cp etc apt sources.list cp etc apt sources....

樹莓派安裝Mysql

安裝mysql,安裝過程中會要求輸入2次密碼 sudo apt get install mysql server 啟動mysql,預設是自動啟動 sudo service mysql start 關閉mysql sudo service mysql stop 重啟mysql sudo service...

樹莓派 2安裝MySQL

上一節我主要記錄了樹莓派的啟動使用,這一節主要記錄下在樹莓派上面安裝mysql,因為我要在上面執行nlifebill所以我就先安裝mysql。首先我想啟用root使用者,所以我先啟用root使用者 sudo passwd root 這裡會提示輸入兩次密碼,然後 sudo passwd unlock ...