Yesterday is a history, tomorrow is a mystery, but today is a gift.html
mysql 在树莓派 raspberry pi 上的安装和在 Linux 上的差很少,由于网上的教程只是记述了一部分且遇到了状况,就整理下来mysql
sudo apt-get update
sudo apt-get install mysql-server
接下来就是安装过程了,原本觉得中间会提示输入密码,结果一口气就安装完了,想到该怎么登录啊linux
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 Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
注:遇到陌生的 MariaDB,百科了发现是 mysql 的一个分支,彻底继承 mysql 的用法,因此也不担忧了,不过,这个应该是看我的状况的sql
# 数据库中使用
# 链接数据库
use mysql;
# 修改密码为123456,本身定
UPDATE user SET password=PASSWORD('123456') WHERE user='root';
# 刷新
flush privileges;
# 退出
exit;
sudo /etc/init.d/mysql status/start/stop/restart
安装以后须要修改密码,否则密码为空shell