我正在编写一个简单的bash脚本来在Ubuntu上安装MysqL。
#!/bin/bash apt-get update # Install MysqL5 aptitude -y install MysqL-server MysqL-client libMysqLclient15-dev
这样更容易
原文链接:https://www.f2er.com/bash/388280.htmlinstall mysql on ubuntu without password prompt
sudo debconf-set-selections <<< 'MysqL-server-5.1 MysqL-server/root_password password your_password' sudo debconf-set-selections <<< 'MysqL-server-5.1 MysqL-server/root_password_again password your_password' sudo apt-get -y install MysqL-server
如果你的shell不支持这里的字符串(zsh,ksh93和bash支持它们),请使用:
echo ... | sudo debconf-set-selections