Connect with us

Hi, what are you looking for?

Linux

How to Install MySQL Database Server on CentOS 7

What is MySQL Database Server?

MySQL database server MySQL is a RDBMS that is stand for relational database management system.MySQL has more than 11 million installations. The program runs as a server providing multi-user access to a number of databases and most advanced updated SQL features.

MySQL Quick Snapshots

  • mysqld – the MySQL server
  • mysql – the MySQL command-line tool

Installation of MySQL Database Server on CentOS/RHEL/Scientific/Oracle Linux 7/6/5

Step-I (Installation of MySQL & MySQL Server)
# yum install mysql-server mysql
Step-II (Configure MySQL Configuration Files)
# vi /etc/my.cnf
[mysqld]
default-character-set=utf8
Step-III (Starting of mysqld daemon)
on normal mode
# /etc/init.d/mysqld start
on safe mode
# cd /usr
# /usr/bin/mysqld_safe &
Step-IV (Test the MySQL daemon with the benchmarks in the ‘sql-bench’ directory)
# cd sql-bench
# perl run-all-tests
Step-V (Set a mysqladmin root password)
# /usr/bin/mysqladmin -u root password 'new-password'
# /usr/bin/mysqladmin -u root -h techbrown.com password 'new-password'
Step-VI (Check MySQL Address)
# netstat -anp |grep mysql
# ps -ef |grep mysql
Step-VII (Starting of MySQL Shell)
As a normal user
# mysql
Enter password:
mysql>
As a root user
# mysql -u root -p
Enter password:
mysql>
Step-VIII (Remove MySQL Password)
# /etc/init.d/mysqld stop
# mysqld_safe --skip-grant-tables &
# mysql
mysql> use mysql;
mysql> update user set Password= ‘ ’ where User=‘root’;
mysql> commit;
mysql> flush privileges;
mysql> quit;
# /etc/init.d/mysqld restart
# mysql
mysql>
Step-IX (See the MySQL Database)
mysql> show databases;
Step-X (Change the MySQL Database)
mysql> use mysql;
Database changed
Step-XI (See the MySQL Database Table)
mysql> show tables;
Step-XII (See the MySQL Database Function)
mysql> describe func;
Step-XIII (User Queries in MySQL Database)
mysql> select * from user
mysql> select Host,User,Password from user;
mysql> select Host,User,Password from user where user='root';
Step-XIV (Create a MySQL Database)
mysql> create database techbrown_db;
Step-XV (Create a MySQL Database Table)
mysql> use techbrown_db;
Database changed
mysql> create table techbrown_table(name VARCHAR(15),email VARCHAR(15),phone_number INT,ID INT NOT NULL AUTO_INCREMENT,primary key(ID));
mysql> show tables ;
Step-XVI (Inserting Information into MySQL Database)
mysql> select * from techbrown_table;
mysql> insert into techbrown_table (name,email,phone_number)values("TechBrown","info@techbrown.com",0123456789);
mysql> select * from techbrown_table;
Step-XVII (Deleting Information into MySQL Database)
mysql> delete from techbrown_table where phone_number=0123456789;
mysql> select * from techbrown_table;
Step-XVIII (Exit from MySQL Shell)
mysql> exit

Congratulation now you have completed MySQL Database Server Configurations.

Comments
Advertisement
Advertisement

Linux

DNF stands Dandified YUM and this is the default package manager for RHEL 8 / CentOS 8.  This tutorial explains you how to create...

Linux

If you forget a root password of your RHEL 8 and CentOS 8 and want to reset the password so that the RHEL 8...

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Linux

How to Upgrade WordPress Server from Ubuntu 16.04 to Ubuntu 18.04. Right now, Ubuntu 18.04 has been released with tons of new features. Upgrading...

Linux

How to Enable TLS 1.3 on Nginx Web Server. Nginx is a ultra fast web server optimized for modern web applications and servers. TLS...

Advertisement

You May Also Like

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Linux

DNF stands Dandified YUM and this is the default package manager for RHEL 8 / CentOS 8.  This tutorial explains you how to create...

Windows

How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...

Windows

How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...