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

Step-I (Installation of MySQL & MySQL Server)
# yum install mysql-server mysql
Step-II (Configure MySQL Configuration Files)
# vi /etc/my.cnf
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:
As a root user
# mysql -u root -p
Enter password:
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
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

That’s all for now.

How to Configure phpMyAdmin with MySQL Database on CentOS / RHEL

Previous article

How to Install LAMP Stack on CentOS / RHEL

Next article

You may also like


Leave a reply

Your email address will not be published. Required fields are marked *

More in Linux