Error: mysql57-community-release conflicts with mysql-community-release-el7-7.noarch
#rpm -qa | grep mysql to query list all rpm packages related to mysql
sudo rpm -e --nodeps mysql80-community-release-el7-3.noarch
Also Installation and Removal RPM
# rpm -i --install (install new RPM; error if already installed) # rpm -U --upgrade (delete existing RPM, if any; install new) # rpm -F --freshen (update RPM only if package already installed) # rpm -e --erase (remove, delete, expunge)
Step 1 – Install MySQL on Amazon Linux
The Amazon Linux default repositories contains Mariadb packages for the installation. To install MySQL community relese, first configure MySQL yum repository on your machine.
sudo rpm -Uvh https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
After that run the following command to install the MySQL 5.7 packages on your systems. This will also install all other required dependencies.
sudo yum install mysql-community-server
Once the MySQL installation completed on your Amazon Linux system. You need to enable the MySQL service to start on system boot. Also, start service using the following commands:
sudo systemctl enable mysqld sudo systemctl start mysqld
Once you start MySQL server for the first time, an auto generated password is set for the root account. You can find this password in MySQL logs.
sudo grep 'temporary password' /var/log/mysqld.log 2020-10-31T06:37:32.258128Z 1 [Note] A temporary password is generated for [email protected]: /c5>WMwMHmaV
Step 2 – Post Installation Setup
Enter the root password found in above step, then set a new password for mysql root account. Next, follow the onscreen instructions and Press Y for all other operations to apply improved security.
Securing the MySQL server deployment. Enter password for user root: The existing password for the user account root has expired. Please set a new password. New password: Re-enter new password: The 'validate_password' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : n ... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!
Step 3 – Connect MySQL Terminal
All done. You can now connect to the MySQL server using the command line. The following command will connect MySQL running on localhost as the root user. This will prompt for the root account password.
mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.7.32 MySQL Community Server (GPL) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>