Saturday, 13 March 2021

MySQL Vs MongoDB

 MySQL is a full-featured open-source relational database management system (RDBMS) that was originally built by MySQL AB and currently owned by Oracle Corporation. It stores data in tables that are grouped into a database, uses Structured Query Language (SQL) to access data and such commands as ‘SELECT’, ‘UPDATE’, ‘INSERT’ and ‘DELETE’ to manage it. Related information can be stored in different tables, but the usage of JOIN operation allows you to correlate it, perform queries across various tables and minimize the chance of data duplication.

MySQL is compatible with nearly all operating systems, namely Windows, Linux, Unix, Apple, FreeBSD and many others. It supports various storage engines, like InnoDB (it is the default one), Federated, MyISAM, Memory, CSV, Archive, Blackhole and Merge.


MySQL is well-recognized for its high performance, flexibility, reliable data protection, high availability, and management ease. Proper data indexing can solve the issue with performance, facilitate interaction and ensure robustness. But if your data is unstructured and complex, or if you can’t pre-define your schema, you’d better opt for MongoDB. And what is more, if you need to handle a large volume of data and store it as documents — MongoDB will help you to meet the challenges.


For more information about MongoDB refer below link

https://microsoft007.blogspot.com/2018/09/3-ways-to-configure-springcontainer.html

How to install and run mysql 8.0.13 in Windows

1)Create my.ini file in root directory of mysql with below data

[mysqld]

# set basedir to your installation path

basedir="C:\\mysql-8.0.21-winx64"

# set datadir to the location of your data directory

datadir="C:\\my_data\\data"

2)In mysql 8.0.13 zip package initializing.

1.     Verify that data folder is empty.

2.     Under the mysql bin path run

mysqld.exe --initialize-insecure

mysqld –-console

mysql –u root

show databases

 

3.     Add to my.ini native mysql

[mysqld]

default_authentication_plugin=mysql_native_password

   4. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';

        mysql> flush privileges;


How to create a new database:

CREATE DATABASE auth;

CREATE USER 'auth_user'@'localhost' IDENTIFIED BY 'auth_pwd';

GRANT ALL PRIVILEGES ON * . * TO 'auth_user'@'localhost';