https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
As Done on BingTest...
On Unix, use the following procedure to reset the password for the MySQL 'root'@'localhost' account.
To change the password for a root account with a different host name part, modify the instructions to use that host name.
The instructions assume that you start the MySQL server from the Unix login account that you normally use for running it. For example, if you run the server using the mysql login account, you should log in as mysql before using the instructions. Alternatively, you can log in as root, but in this case you must start mysqld with the --user=mysql option. If you start the server as root without using --user=mysql, the server may create root-owned files in the data directory, such as log files, and these may cause permission-related problems for future server startups. If that happens, you must either change the ownership of the files to mysql or remove them.
# kill `cat /var/run/mysqld/mysqld.pi`/root/mysql-init) containing the password-assignment statement on a single line. Replace the password with the password that you want to use.ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
$> mysqld --init-file=/root/mysql-init &--defaults-file may be needed before the init_file argument.B.3.3.2.3 Resetting the Root Password: Generic Instructions
The preceding sections provide password-resetting instructions specifically for Windows and Unix and Unix-like systems.
Alternatively, on any platform, you can reset the password using the mysql client (but this approach is less secure):
Stop the MySQL server if necessary, then restart it with the --skip-grant-tables option. This enables anyone to connect
without a password and with all privileges, and disables account-management statements such as ALTER USER and SET PASSWORD. Because this is insecure, if the server is started with the --skip-grant-tables option, it also disables remote connections by enabling skip_networking.
Connect to the MySQL server using the mysql client; no password is necessary because the server was started with --skip-grant-tables:
$> mysql
In the mysql client, tell the server to reload the grant tables so that account-management statements work:
mysql> FLUSH PRIVILEGES;
Then change the 'root'@'localhost' account password. Replace the password with the password that you want to use. To change the password for a root account with a different host name part, modify the instructions to use that host name.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
You should now be able to connect to the MySQL server as root using the new password. Stop the server and restart it normally
(without the --skip-grant-tables option and without enabling the skip_networking system variable).
Hello, Thank you for contacting AWS Premium Support. My name is Jacob and I will be assisting you with this case today. I understand that you are having some issues with your mysql instance and that, more specifically, the root password for your mysql database isn't working anymore. You would like to find a way to be able to reset the root password for this mysql database. You are also having issues getting mysql to start without needing to give the /var/log/mysqld.log file 777 permissions and would like to understand why. Please correct me if my understanding is incorrect, or if there are any additional details I should be aware of. If you have a working backup of this instance then I recommend using it to restore the instance back to a working state as it will provide the quickest resolution, causing the least amount of disruption to your services. For similar reasons I recommend creating regular backups of your instances.[1] For resetting the root password for your mysql database I would like to refer you to the official mysql documentation on this as it provides detailed, step by step instructions on resolving this issue. [2] As for the issue you are experiencing with having to give the log file absolute permissions, I recommend checking who the owner of that file is. It is possible that the OS user with which mysql is trying to run do not have adequate permissions or is not part of the group that has access to the file. If you are able to provide the specific error details that you get when trying to launch mysql without giving the log file 777 permissions I can try troubleshooting this further for you and provide any recommendations to resolve this. Since these issues are systems administration related, we are limited in what we are able to do with the information we have. [3] Please feel free to reach out and reply back to this correspondence if you have any questions or concerns and I’ll be more than happy to address them for you. References: [1] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html [2] https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html [3] https://aws.amazon.com/compliance/shared-responsibility-model/ We value your feedback. Please share your experience by rating this and other correspondences in the AWS Support Center. You can rate a correspondence by selecting the stars in the top right corner of the correspondence. Best regards, Jacob K. Amazon Web Services