Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
26 views

MySQL Installation and Server Configurations Step by Step

The document provides steps to install and configure MySQL server on Red Hat Enterprise Linux 7. It outlines downloading and installing RPM packages in sequence. It also describes enabling and starting the MySQL service, securing it with mysql_secure_installation, and editing the my.cnf configuration file to configure properties like the data directory, port, and log settings. Finally, it shows how to use the Information_Schema to obtain metadata about databases and tables.

Uploaded by

Mercedez Benz
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

MySQL Installation and Server Configurations Step by Step

The document provides steps to install and configure MySQL server on Red Hat Enterprise Linux 7. It outlines downloading and installing RPM packages in sequence. It also describes enabling and starting the MySQL service, securing it with mysql_secure_installation, and editing the my.cnf configuration file to configure properties like the data directory, port, and log settings. Finally, it shows how to use the Information_Schema to obtain metadata about databases and tables.

Uploaded by

Mercedez Benz
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

MySQL Installation and Server Configurations Step by Step

In my case operating system is RED HAT ENTERPRISE LINUX (7) and the version of Installed MySQL is
8.0.27

Installation of MySQL Step by Step:

 All the Installation will be done through ROOT user


 Before the installation you should remove extra plugins so there will be no chances of errors by
using this command
-> yum remove -y mariadb-libs
 Untar the RPM bundle
->tar -xvf (File Name)
 All the packages have been untarred. Important thing is All the rpm packages should be installed
in a sequence.
rpm -ivh mysql-community-common
rpm -ivh mysql-community-client-plugins
rpm -ivh mysql-community-libs
rpm -ivh mysql-community-libs-compat
rpm -ivh mysql-community-client
rpm -ivh mysql-community-server.8.0.27
 To start mysql server
-> systemctl start mysqld
 To enable mysql server
-> systemctl enable mysqld
 To check the status of mysql either it is active or not
-> systemctl status mysqld
 For the checking of temporary password:
-> cat /var/log/mysqld.log | grep password
 Login through temporary password
-> mysql -uroot -p
-> (Enter temporary password)
 Change the temporary password
-> alter user ‘root’@localhost’ identified by ‘Your New-Password’;
->exit
 All the directories are in cat /etc/my.cnf
 To secure MySQL Server Run:
/usr/bin/mysql_secure_installation
 MySQL will ask five questions and the answers of these questions are following respectively
1) No 2)Yes 3)Yes 4)Yes 5)Yes
 Test the configuration by using -> systemctl status mysqld and ->mysql -uroot -p

Installation of MySQL is done successfully.

#Edited by Faisal Hushaim


Configuration of MySQL Server Step by Step:
All the configuration will be done through Root user
 Copy my.cnf file to root
-> cp /etc/my.cnf /root
 Edit my.cnf file
-> vi /etc/my.cnf
Add the under given portion into the file
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
port=3306

symbolic-links=0
general_log
log-bin=mybinlog
slow_query_log

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[client]
port=3306
 Restart the service
->systemctl restart mysqld

#Edited by Faisal Hushaim

Obtaining Metadata Using Information Schema:

 $ mysql -uroot -p(ur password)


 Type the command select * from information_schema.schemata where
schema_name='database name'\G
Listing the number of tables, per storage engine, for each database by using a select statement with a
group by clause against the Tables table in the Information_Schema database.

You might also like