mysql tutorial
site:.in "language" "create new useraccount here"
termux phpmyadmin
Mysql is an open source relational database management system developed by orcale corporation, it works on all types of operating systems such as windows and linux, many languages such as C, C++, java, ApI works for perl, php, python and ruby It is a standard form of SQL structure query language. It works smoothly and quickly with lots of data sets. This is a very good language for web development and you do not have to pay any money to use it.
MySQL data type
1 numeric data
In this type of data only numeric value is stored and type of data such as int i.e. integer and its limit is used while creating the field.
2 string data
This type of data type is used to store words such as char or varchar and then after setting their limit
3- date and time data
For this type of data the date time is to be stored in the format like date and then for date it is seen how to store the data
4-large object data
Object data is stored in this object data becomes a place for an object when it is set framework 4.5.2
2- Microsoft visual C++ studio 2015-19
3- RAM 4GB
mysql for beginners
To use mysql, first open your command prompt and as you know mysql inside the program file of your C drive and then inside MYsql server 8.0 go to the bin folder and open it then go to its properties and its path Copy and paste it in command prompt and type Cd
Cd C: -\program Files\MySql\MySql Server8.0\bin
Such an interface will come and then by entering your user id and password, open Mysql in the command prompt
mysql database
As we all know, database means a museum of data, now this data can be of any kind, but this data is under a correct structure format in the database, in which there are some fields and there is information inside these fields. Database is like a container like a database has many tables and one table has many columns and data is stored in those columns now you must have understood database how to create database in SQL
Ckick here for phpMyAdmin
mysql create database
create database test;
command is used where test is the name of the database with the same name we are creating the database
To see all the databases you have now
show databases;
Using the command, this will list all the databases, now to select any database in these list use test;
How to learn PHP
We will use the command, in this way we can select any database and work inside it
mysql create table
As we know when the database is created in the database, after that a table has to be created and many fields have to be given to create the table, the data is stored according to the field, so let's see how the table and its field is made
Learn Python langauage
mysql example table
create table john(id Int(3), first_name varchar(20), last_name varchar (20), Sex char(1), date_of_birth date);
In the above command, a table named john is being created in which many fields have been given and their data type and its limit have also been given in those fields so that the blueprint of a table can be prepared.
Or
mysql command line
create table test.1234(id Int(3), `first name` varchar(20), `last name` varchar (20), Sex char(1), `date of birth` date);
The table name in the second command is in the form of numbers and the table of numbers cannot be created in SQL, for that it has to first put the name of the database, after that we see that there is no space in the SQL inside the field. If you want to put space, then it has to be written inside `` which is given in the above command, thus our table is ready, now to see the table created
Describe john;
command is used and to view all the tables inside a database
show tables;
We use the command if we want to add or add any other column inside a table then for that
alter table john add email varchar(20) after sex;
Or
alter table john add email varchar(20);
Or
alter table john add email varchar(20) first;
The command is used, in the above three examples, how the column is added, it has been told that if you do not give any location while adding a pen, then it is automatically added to the last.
Drop column
mysql insert query
Mysql Crate user
User account has to be created inside the database so that it can work and it requires user id and password by default user id root and password is null in sql but if you want to create new user then for that
mohit@localhost identified by 123456;
Using the command, mohit is the user id in it and local host is the address of his host, if you use any IP address there, then he can use it in place of local host, then after identified by the password which you can use as your user. You can fill the password here 123456 has been used, now what privileges have to be given to that user.
Grant all privileges on *.* to mohit;
Now in the above command all the privileges have been given to the user, now he can do everything inside the database like drop, create user etc. Now if you want which privilege has been given to a user then for that
Show grants for mohit;
You can see how many users are there in a database to see them.
select user from database.user;
Or
select user();
Now if you want to drop a user, then for that you have to
Drop user mohit@localhost;
You have to use the command if you have to cost a user to change his password.
set password for mohit = abcd;
Use the same command to change a user
alter user naresh identified by zyada
using the command
I hope you have got all the commands and basic knowledge of mySQL
I hope that you must have understood SQL easily, you must have come to know its basics.
0 Comments