在Linux系統上,查看MySQL的密碼位數可以通過以下步驟來完成。
$ sudo mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.28-0ubuntu0.18.04.4 (Ubuntu) Copyright (c) 2000, 2020, Oracle and/or its affiliates. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>SELECT LENGTH(User_Password) FROM mysql.user WHERE User = 'root'; +------------------------+ | LENGTH(User_Password) | +------------------------+ | 41 | +------------------------+ 1 row in set (0.00 sec)
首先我們需要以root用戶身份登錄MySQL,然后執行“SELECT LENGTH(User_Password) FROM mysql.user WHERE User = 'root'”查詢語句,將會返回密碼的字符位數。
以上就是在Linux系統上查看MySQL密碼位數的方法。