Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. # Update the system
  3. echo "Updating the system..."
  4. sudo yum update -y
  5. # MySQL Installation for CentOS Stream
  6. sudo dnf install mysql-server -y
  7. sudo systemctl start mysqld
  8. sudo systemctl enable mysqld
  9. MYSQL_ROOT_PASSWORD=$(sudo grep 'temporary password' /var/log/mysqld.log | tail -n 1 | awk '{print $NF}')
  10. echo "MySQL root temporary password: $MYSQL_ROOT_PASSWORD"
  11. sudo mysql_secure_installation
  12. bash elxr/mysql.init.sh
  13. # Install the MySQL repository
  14. # echo "Installing MySQL repository..."
  15. # sudo yum localinstall -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
  16. # # Enable the MySQL repository
  17. # echo "Enabling MySQL repository..."
  18. # sudo yum-config-manager --enable mysql80-community
  19. # # Install MySQL server
  20. # echo "Installing MySQL server..."
  21. # sudo yum install -y mysql-server
  22. # # Start MySQL service
  23. # echo "Starting MySQL service..."
  24. # sudo systemctl start mysqld
  25. # # Enable MySQL to start on boot
  26. # echo "Enabling MySQL to start on boot..."
  27. # sudo systemctl enable mysqld
  28. # # Get the temporary MySQL root password
  29. # TEMP_PASS=$(sudo grep 'temporary password' /var/log/mysqld.log | tail -n 1 | awk '{print $NF}')
  30. # echo "Temporary MySQL root password: $TEMP_PASS"
  31. # # Secure MySQL installation (you can modify the commands for automation if desired)
  32. # echo "Securing MySQL installation..."
  33. # sudo mysql_secure_installation <<EOF
  34. # y
  35. # $TEMP_PASS
  36. # newpassword
  37. # newpassword
  38. # y
  39. # y
  40. # y
  41. # y
  42. # EOF