This guide works with most linux distributions.
This is the second part of my blog about Installing
MySQL Database Server—Community Edition on an
AWS EC2 instance. In part one, we encountered a crucial issue
where our database server stopped listening on port 3306 for
security reasons, which was preventing our backend code from
connecting to it. This part will provide the solution to this
significant issue.
If you missed part one, you can still check it
here.
Now, let's dive into the solution!
The solution is simple; we only have to change the root user's
password and remove the
--skip-grant-tables
we added in the previous part.
mysql -uroot
SQL
statements:
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY
'MyNewPass';
exit;
mysql -uroot
mysql -uroot -p
--skip-grant-tables
we added earlier in the
/etc/my.cnf
because they are no longer required.
sudo systemctl restart mysqld
sudo lsof -i :3306
mysql -uroot -p
In this blog, we saw how to install MySQL Database Server—Community
Edition on AWS EC2 instances and change the root account's
password.
Remember to remove the
--skip-grant-tables
!