Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Installing and Uninstalling MySQL 8.0 with Common Error Resolution

Tech 1

Installing MySQL 8.0

Operations assume execution under the root account.

  1. Create the target directory:
cd /usr/local
mkdir db_mysql
  1. Retrivee the repository package:
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
  1. Register the MySQL YUM repository:
yum -y localinstall mysql80-community-release-el7-3.noarch.rpm
  1. Install the repository metadata:
rpm -ivh mysql80-community-release-el7-3.noarch.rpm
  1. Install the server component:
yum install mysql-community-server

If GPG verification fails with a message such as Failing package is: mysql-community-client-8.0.36-1.el7.x86_64, retry with signature check disabled:

yum install mysql-community-server --nogpgcheck
  1. Start the database service and configure boot behavior:
systemctl start mysqld
service mysqld status
systemctl enable mysqld
systemctl daemon-reload
  1. Access the instance:

The initial root password is written to the log:

grep "A temporary password" /var/log/mysqld.log
mysql -u root -p

If authentication fails (Access denied for user 'root'@'localhost'), disable credential checks temporari:

service mysqld stop

Edit /etc/my.cnf and append:

skip-grant-tables

Restart the service:

service mysqld start

Then connect and reset credentials:

FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewStrongPwd123!';

Passwords must meet default complexity rules unless adjusted.

  1. Adjust password policy parameters:

Inspect current settings:

SHOW VARIABLES LIKE 'validate_password%';

To simplify requirements:

SET GLOBAL validate_password.policy = 0;
SET GLOBAL validate_password.length = 4;

Removing MySQL 8.0

Applicable to other versions with minor adjustments.

  1. Stop the running service:
systemctl stop mysqld
  1. Enumeraet installed packages:
rpm -qa | grep mysql
  1. Remove packages via YUM:
yum remove mysql mysql-server mysql-libs mysql-common
  1. Verify no packages remain:
rpm -qa | grep mysql
  1. Purge leftover files and directories:
# Remove any residual RPM entries shown in step 4
rpm -e <package_name>
rm -rf /usr/local/db_mysql
rm -rf /var/lib/mysql
rm -rf /etc/my.cnf
Tags: MySQL

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.