[go: up one dir, main page]

0% found this document useful (0 votes)
46 views3 pages

MYSQL 8 - Installation

Uploaded by

pratik.kotecha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views3 pages

MYSQL 8 - Installation

Uploaded by

pratik.kotecha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

MYSQL 8.0 Installation.

Note: - All the below commands are to be run as root user.

Steps for a Fresh Installation of MySQL


Follow the steps below to install the latest GA version of MySQL with the MySQL Yum repository:

1) To avoid conflict of the different of MYSQL we need to first disable the default
MYSQL module.
To disable the module, copy and paste the below command.
yum module disable mysql -y
Once done your good to go with the fresh installation of MYSQL.
2) Adding the MySQL Yum Repository
This is a one-time operation, which can be performed by installing an RPM provided by MySQL.

Download the MYSQL RPM from the below URL and install.

https://dev.mysql.com/get/mysql80-community-release-el8-4.noarch.rpm

The installation command adds the MySQL Yum repository to your system's repository list and
downloads the GnuPG key to check the integrity of the software packages.

3) Installing MySQL
To install MySQL 8.0, copy and paste the below command.

yum install mysql-community-client.x86_64 mysql-community-common.x86_64 mysql-community-


devel.x86_64 mysql-community-libs.x86_64 mysql-community-server.x86_64 mysql-connector-
odbc.x86_64 -y.

Now the installation is completed we will start configuring MYSQL.


1) Replace the my.cnf file in /etc the with the one provided in the mail.

To replace the file, first upload the my.cnf file to the server, once the file is uploaded to the server
use the below command to replace the file.

cp -r my.cnf /etc/

once you execute the command you will receive below warning message.

cp: overwrite './my.cnf'?

press y and hit enter.

Once copied we will now try to start mysql service.


systemctl start mysqld.service

If you don’t receive any message after executing the above command that means MySQL has started
successfully.
Let’s now confirm whether the service is running or not.

To confirm, copy and paste below command

systemctl status mysqld.service

You should see something like below sample.

● mysqld.service - MySQL Server

Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)

Active: active (running) since Fri 2022-10-07 10:15:07 IST; 6s ago

Docs: man:mysqld(8)

http://dev.mysql.com/doc/refman/en/using-systemd.html

Process: 68651 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)

Main PID: 68681 (mysqld)

Status: "Server is operational"

Tasks: 162 (limit: 205240)

Memory: 1.5G

CGroup: /system.slice/mysqld.service

└─68681 /usr/sbin/mysqld

Oct 07 10:15:03 mktg207129 systemd[1]: Starting MySQL Server...

Oct 07 10:15:07 mktg207129 systemd[1]: Started MySQL Server.

If you see active and running, this means your good to go further.
Now lets login to mysql and finish the setup

To login to mysql you need to find the password which has already been generated while starting
the MySQL service.

To find the password, copy and paste below command.

grep -i password /var/log/mysqld.log

The output will be similar to the below example, instead of xxxxxx you find the auto generated
password in that place, Just select the password and it will be copied automatically.

2022-10-06T09:07:32.161938Z 6 [Note] [MY-010454] [Server] A temporary password is generated


for root@localhost: xxxxxxxxxxxx

Now let’s login to MySQL.

mysql -u root -p
Once you hit enter you will be prompted for password just right click on the mouse and the
password will be pasted, now again hit enter and you will enter mysql command prompt, similar to
one below.

“Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 8

Server version: 8.0.30 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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>”

On the mysql command prompt, copy and paste below password.

mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'Put a strong complex password in this place';

This will change the mysql auto generated password to custom password.

All done.

You might also like