MySQL

Introduction
MySQL is one of most popular open source relational database system.

Reset root Password

Write the below command to an text file mysql-init.txt

update mysql.user set password=password(‘mynewpass’) where user=’root’;
flush privileges;

Windows
C:mysqlbinmysqld –init-file=C:\mysql-init.txt

UNIX
mysqld_safe –init-file=/home/me/mysql-init &

User creation
Create user ‘tstusr’@’localhost’ identified by ‘tstusr’;

Grant Privs
Grant all on *.* to ‘tstusr’@’localhost’

Database Creation
Create database test;

Table Creation
Create table test.emp (id integer, name varchar(50));

DML
Insert into test.emp values (1, ‘test’);
commit;