Database

How to setup mySQL from Scratch in debian based (UBUNTU, Mint) System.

Please put below commands sequencially and let me know in comments if you face any problems.
  • sudo apt-get install mysql-server -y
    • it will require you to enter password.
  • mysql -u root -p
    • it will require you to enter the same password as entered in previous step.
At the starting you will have no database to connect, So we will create new database for testing
  • CREATE DATABASE testdb;
  • SHOW DATABASES;
  • select testdb;
  • create Table Mov1( id int, mov_name varchar(255), genere varchar(255));
  • create Table Mov2( id int, mov_name varchar(255), genere varchar(255));
  • show tables;
  • Desc table Mov1;
So these are the basic steps to create and connect for MySql Database.


Next Thing one should be aware of SQL Constraints which allows to have data with some business constraints, without which it will be a DISASTER!!!!

Its important to learn SQL Constraints in this regards


Comments