EC2 SUSE Linux mysql installation issue

0

Hello, I am attempting to install mysql on SUSE linux instance. When attempting to start mysql server, the system requires a root password I am logged in as the ec2-user as it is the default. How can get past the root password issue and start mysql server and complete the installation.

Thank you

Msd
已提問 1 個月前檢視次數 356 次
1 個回答
0

The ec2-user is the default user for EC2 instances, not the root user for the MySQL server. The root user for the MySQL server is a separate user that is managed by the MySQL service.

Please try these steps:

  1. Stop the MySQL service: sudo systemctl stop mysql

  2. Start the MySQL server in safe mode: sudo mysqld_safe --skip-grant-tables &

    This will start the MySQL server without requiring a password.

  3. Connect to the MySQL server: sudo mysql

    You should now be able to connect to the MySQL server without a password.

  4. Set a new root password: ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_password';

    Replace 'your_new_password' with a secure password.

  5. Flush the privileges:

    FLUSH PRIVILEGES;

  6. Stop the MySQL server:

    exit

  7. Start the MySQL service with the new password:

    sudo systemctl start mysql

Now, you should be able to start the MySQL server with the new root password you just set.

AWS
已回答 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南