This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config_mysqld() { | |
| _info "Change MySQL Password ..." | |
| db_pass="" | |
| ${mysql_location}/bin/mysqld --initialize-insecure --user=mysql >>/var/log/initialize.log 2>&1 | |
| ${mysql_location}/bin/mysql_ssl_rsa_setup | |
| /usr/local/bin/mysql -e "grant all privileges on *.* to root@'127.0.0.1' identified by \"${db_pass}\" with grant option;" | |
| /usr/local/bin/mysql -e "grant all privileges on *.* to root@'localhost' identified by \"${db_pass}\" with grant option;" | |
| /usr/local/bin/mysql -uroot -p${db_pass} -e "grant all privileges on *.* to root@'%' identified by \"${db_pass}\" with grant option;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Detect OS | |
| # $os_version variables aren't always in use, but are kept here for convenience | |
| if grep -qs "ubuntu" /etc/os-release; then | |
| os="ubuntu" | |
| os_version=$(grep 'VERSION_ID' /etc/os-release | cut -d '"' -f 2 | tr -d '.') | |
| elif [[ -e /etc/debian_version ]]; then | |
| os="debian" | |
| os_version=$(grep -oE '[0-9]+' /etc/debian_version | head -1) | |
| elif [[ -e /etc/almalinux-release || -e /etc/rocky-release || -e /etc/centos-release ]]; then | |
| os="centos" |
NewerOlder