84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
!/bin/bash
apt-get install -y mysql-server
通过脚本安装mysql时,如何自动输入mysql root密码
光阴似箭催人老,日月如移越少年。
If you install it with root, you don’t need a password. If you are an ordinary user and call sudo directly, you can only use methods such as expect, or change /etc/sudoers so that you do not need to enter a password.
mysql -u root -ppasswd root is the username, passwd is the user’s password
Note that there should be no space between -p and password
Is this what you mean?
DEBIAN_FRONTEND=noninteractive apt install -y mysql-server
If you install it with root, you don’t need a password.
If you are an ordinary user and call sudo directly, you can only use methods such as expect, or change /etc/sudoers so that you do not need to enter a password.
mysql -u root -ppasswd
root is the username, passwd is the user’s password
Note that there should be no space between -p and password
Is this what you mean?