日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

树莓派要mysql的密码_树莓派raspberry Pi 3B+系统中安装mysql过程中不提示输入密码,安装完后如何设置密码...

發(fā)布時間:2023/12/10 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 树莓派要mysql的密码_树莓派raspberry Pi 3B+系统中安装mysql过程中不提示输入密码,安装完后如何设置密码... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

樹莓派raspberry Pi 3B+安裝mysql未提示輸入密碼,安裝后修改mysql密碼默認密碼

使用mysql -uroot -p 命令連接mysql時,報錯

pi@raspberrypi:/ $ mysql -uroot -p

Enter password:

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

按照網上的說法,

1.進入到etc/mysql 目錄下,查看debian.cnf文件,使用默認的用戶名和密碼登錄

pi@raspberrypi:/etc/mysql $ sudo cat debian.cnf#Automatically generated for Debian scripts. DO NOT TOUCH!

[client]

host=localhost

user=root

password=socket= /var/run/mysqld/mysqld.sock

[mysql_upgrade]

host=localhost

user=root

password=socket= /var/run/mysqld/mysqld.sock

basedir= /usr

結果是默認密碼是空,多次嘗試不成功,依然報錯。

最后輸入:sudo mysql -uroot(使用root身份免密碼登錄,一定要sudo,不要輸入-p??? 否則進不去,我就是嘗試多次,不成功)

終于進入系統(tǒng)

pi@raspberrypi:/ $ sudo mysql -uroot

Welcome to the MariaDB monitor. Commands end with ;or\g.

Your MariaDB connection idis 5Server version:10.1.37-MariaDB-0+deb9u1 Raspbian 9.0Copyright (c)2000, 2018, Oracle, MariaDB Corporation Ab andothers.

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

MariaDB [(none)]>

原來系統(tǒng)用的mysql的版本是MariaDB,是mysql的一個主要分支,但是它全面兼容mysql。

后續(xù)的操作按照網上介紹的內容繼續(xù)操作:

MariaDB [(none)]>show databases;+--------------------+

| Database |

+--------------------+

| information_schema |

| mysql |

| performance_schema |

+--------------------+

3 rows in set (0.01 sec)

然后使用use mysql; 命令打開數據庫。

MariaDB [(none)]> use mysql;

MariaDB [mysql]> update user set authentication_string=("你要設置的密碼") where user='root';

Query OK,1 row affected (0.00sec)

Rows matched:1 Changed: 1Warnings: 0

MariaDB [mysql]> update user set plugin="mysql_native_password";

Query OK,1 row affected (0.00sec)

Rows matched:1 Changed: 1Warnings: 0

MariaDB [mysql]>flush privileges;

Query OK, 0 rows affected (0.00sec)

MariaDB [mysql]>quit;

Bye

重啟樹莓派正常登錄

此方法也使用與Ubuntu16以上的版本。

總結

以上是生活随笔為你收集整理的树莓派要mysql的密码_树莓派raspberry Pi 3B+系统中安装mysql过程中不提示输入密码,安装完后如何设置密码...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。