MySQL Workbench Tutorial for Beginners | Learn Workbench in 40 minutes | Amit Thinks | 2023

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Welcome to Amit thinks YouTube channel. In   this video course learn MySQL  workbench and its concepts.   The workbench is a UI that is a graphical tool  for working with MySQL servers and databases.   MySQL is an open-source relational database  management system that is RDBMS. It is one of   the most popular RDBMS wherein records are stored  in the form of tables rows and columns we have   covered the following lessons with live running  examples. Let us start with the first lesson. in this video, we will learn what is MySQL  workbench its features why it is important   how it can easily work of creating databases  and tables and Performing operation let's see   so first let us discuss what is MySQL MySQL  is a relational database management system   that is RDBMS which is based on SQL. SQL based  means you can easily store data in the form of   tables just create a database and under that  create multiple tables every table will be   having rows and columns and you can easily  save your data so mycically Now supported   by Oracle it is being used so it is being  used by top companies like Facebook YouTube   it initially released in 1995 and written in C  and C plus plus so why we are preferring MySQL   workbench instead of the MySQL command line so  we have a MySQL command line as well as workbench   because workbench is a UI you just need to right  click and create a database right click and just   create a table you don't need to write multiple  commands for doing your work I'll show this later   so it is a graphical tool for working with your  MySQL okay let's see the features based on I SQL   I have already discussed it is open source you  can freely download it we will see this later   you can easily support large databases okay  it's basically compatible with PHP you can   connect it with PHP and work around your website  and host your website database under MySQL   it is secure and highly flexible so I just told  you that why we are preferring MySQL workbench   because we could have also gone to mySQL and  work around command line in the next chapter   we'll be working on the installation of both  and will be showing the difference so you can   easily work around that workbench is like this  okay that is it is having a UI to create tables   like this guys we have created tables if you  want to create a new table just right click and   click on create table if you want to import  from a CSV Json file SQL file you can click here   and the results will be visible in this form you  can also export import we will see all this later   and the result will also be visible here stating  that your action your action was correct that is   four rows return that means we successfully ran  this query okay and we have different options to   create a new database also like this create a new  schema that is a database so we can easily work   around the entire UI and and you can either work  create tables databases perform operations easily   we will see this in our complete tutorial so guys  thank you for watching the video in this video we   saw why we are working on workbench and what it  is and how it easy is the work of a administrator   database administrator thank you for watching the  video in this video we will learn how to install   the current MySQL version we will install the  MySQL server shell as well as workbench let's   start at first go to the web browser I am  using Chrome you can use any web browser   on Google type MySQL and press enter on pressing enter official website  is visible mysql.com click on it after clicking mysql.com you need  to go to downloads click on it now go below here and click on MySQL Community downloads now  here in click on MySQL installer for Windows now the current version is visible  for window which is MySQL 8.0.34   it automatically selected on its own no problem  and two versions are visible remember that this   works for 64-bit as well it's written 32-bit but  it will work for 64-bit as well so I'll be so   I'll be downloading the following one not the web  one the second one 331 MB click on it to download   now go below and click no  thanks just start my download started let's wait we have downloaded it here is the MSI  file double click on it to install minimize now I need to choose a setup type  I'll directly go for custom so that uh   I have an idea what I'm doing what I'm installing  click on next now you need to select the products   click on MySQL server drop down MySQL 8.0 and  here it is this is what we wanted click on the   Arrow to drag it here now go to Applications  click on workbench do the same for workbench   these are the ones which we'll be installing go  for shell here it is click on here to drag it now   we have our server workbench in Shell click  on next the installation started let's wait we have successfully installed it click  next Now product configuration click on next now type a network and keep it as it is  it is taking double three zero six port   number no problem click next authentication  method you can use a strong password or the   following Legacy basic but the following is  recommended so keep it as it is and click next   here inside the root password that is  the admin password for your MySQL server you can use any password my password also because it is on localhost click  next Windows service fine click   next server file permissions yes keep  the default Grant full access click next   play configuration click on execute so one by  one all the steps will get executed that's it completed configuration successful click finish click next now keep it as it is start MySQL  workbench initial no problem click finish now we have started the shell and workbench but  we need to set the path for that go to C drive   program files go below MySQL click on it server click on it  bin click on it and copy this path minimize go to start type environment variables   remember to go for system environment variables  click on open click environment variables here now under system variables go below  click on path double click click new   right click and paste the same path  here it is Click ok in the last okay now go to start type CMD click on  open to open the command prompt type the command MySQL space hyphen  iPhone version and press enter you can see we successfully installed the  current version now type MySQL space hyphen U   space root hyphen P here in U is for user  remember it was root and piece for password   press enter enter the same password press enter we successfully installed MySQL  now you can check the databases the default   databases show space databases semicolon  press enter here are the default databases   let us create a new database using the create  database using the create database and database   name herein I am adding a database name amidb  you can add any name press enter here it is   we successfully created it let us verify  show databases semicolon and press enter   here it is we have a mid DB now in this way  you can work around MySQL using a tutorial   the link we have added in the video description  now click on here to open the MySQL workbench   enter the same password click ok so MySQL  workbench is a UI so guys in this video we   saw how we can easily work around MySQL and  install it thank you for watching the video   in this video we will see how we can easily  create a new database and table on MySQL workbench   go to start type CMD click on open to open it here  and type the command MySQL hyphen iPhone version   and here you can see we installed 8.0.27 let's  open workbench go to start type MySQL workbench   on typing you can see MySQL workbench  8.0 is visible click on it to open here you can see while installing  workbench we created a default root user   so now I'll connect to it double click so we are inside the workbench now on  the left you can see we have our schemas   which is also known as database this is the  default one which gets created by default   here these are the tables click  on it here are the columns in it I'll just click on this sign to see The  Columns of the table and the entire table   on double clicking you can see your  table is visible this is a demo table and here the command is visible because we  wanted to see the table so it automatically   executed the query select star from  table name so here are the table columns   from here the index is from here the  foreign keys and triggers are visible   now let's close this here what we'll do we will  just create a new database and a table inside it   for that here the sign is visible on keeping  the cursor you can see create a new schema   or you can also right click here and click on  create schema let's create I have clicked on it   now here add the name of your schema that  is the name of your new database let's say   my database name will be amid DB1  so here you have entered a name   keep the default care set as well as Collision now  I'll click on apply on clicking apply the review   window is visible here the command to create a  new schema is visible I just need to click on   apply here from here you can also understand how  to create a schema in workbench click on apply   on clicking apply you can see SQL script was  successfully applied to the database and click   on finish now on the left you can see we have  a new database we created Amit DB1 database   now here the tables are visible double click  right now nothing would be visible because we   haven't created any table now here you can  click on this sign to create a new table   in the active schema that is the active schema  is Amit DB1 the active database is Amit DB1 so   you can right click on the tables  and click on create table click on it   on clicking you can see the UI is visible to  create a table now let's add the name of the table   I'll give the name employee table let's say  care set and collision I'll keep the default   here you can add comment so that you can refer  later now we need to create columns in it so   just click on this sign now the section is  visible now when you will double click here   it will allow you to add the First Column I'll  double click now you can see we can add our first   column I'll double click here let's say My First  Column is empid type ID I'll go for end obviously   primary key yes I'll set it and not null so every  employee will get a unique employee ID so we have   set it as primary key Now to create a new column  double click here let's add EMP name column   it will be on the wirecare obviously because  it's a string 45 here means it will be 45   characters let's keep it to let's say 60. I'll  go for 60. now let's set it not null because   we want all the records for employees I'll  double click here again and add employee age   will come under int so double click here  and from the drop down you can select int   keep it not null again let's add last  field here I'll go for employee Department   let's keep worker it's fine 45 it should be not  null again now here you can also set the default   value so this is the default constraint if you  won't add any value while inserting this value   will get entered it's a basic table so we will  leave it right now now you just need to click   on apply now you can see our table got created  create table employee table under four columns ID   name agent department and with its data types and  constraints primary key was only employee ID and   the same is visible so now you also know the query  for it it created on its own now click on apply SQL script was successful that means it has   been successfully applied to  the database click on finish now we have created employee  table click on the Mark again   the table Mark and let's see what  is visible here our table is visible so I hope you know that to get values from  a table you need to type select star and   from then the table name so this is what we have  done it automatically shows you the query so you   can learn it in a better way now we have empty  table we have our empty table here because we   haven't added any values now let's add a value so  here is the grid now I'll just double click here now enter the value let's say employee  ID is one employee name let's add   Tom age 25 and Department let's say operations because we added worker here in here  worker here in India now let's add   second value id2 name let's say I'll set  as Emma age let's say 23 and Department   Finance third in the same way I'll add Brad  age let's say 27 and Department let's say   Department let's say marketing  fourth let's add the last record Bradley age 26 Department ID let's say so we  have inserted the records now you need to just   click on apply I'll click on it so these are the  statements for insert I hope you know that to   insert records in a table you need to use insert  into then the table name then you need to add the   column names and then each value after the values  keyword so we have added here now click on apply SQL script was successfully applied  to the database click on finish   now guys our table is having the following  values I'll refresh here and click on the   Mark here table mark here are the values of a  table in the same way you can create a new table   I'll close this let's say right click here create  table so let's add the second table I'll give the   name Department so here is a department table  let's click on the Arrow now add columns to it   let's say I'll double click here Department  let's say I'll add Department ID at first   I'll set it as primary key and not  null now let's add Department name   wire care it's fine not null Department  Zone let's say I'll set it as worker again   not none so we created our second  table let's click on apply here   so this is how you can create a table you can see  it again create table command then the table name   then the values that is column name data type and  constraints column name data type constraints and   the same for the last column primary key we  have set is Department ID now click on apply so here we are executing successful SQL script   was successfully applied to  the database click on finish now on clicking tables we have  two tables department and employee here it is I'll click on the Mark again so this  is our first table and the second table is this   click on it nothing is entered here because we  haven't added any values now let's add values   one name let's add operations Zone let's say it's  north in the same way enter values for others so here we added values now just click on apply so the commands are visible again  two insert values just click on apply   successful again apply to the database finish   so guys we created two tables employee and  Department under under Amit DB database so guys in this video we saw how we can easily  work with mySQL workbench 8 and create a new   database and table we created two tables  department and employee under new database   Amit DB1 that is a schema in this video we will  see how we can easily create a new database or you   can see a schema on MySQL workbench after login  to your MySQL workbench you can see on the left   default schema is visible says and the tables  are visible for the same now what we need to do   we need to create a new schema for that you can  keep the cursor here and you can see create a new   schema you can click here to create a new schema  or you can right click and click on create schema   I'll do the same now add  the name of the new schema let's say my name is Amit and click on I'll  click on apply rest I'll keep the default now herein you can see the SQL script  you could have also directly used create   schema and the schema name now click on  apply you can see SQL script successfully   applied click on finish and on the  left you can see amid schema created so guys in this video we saw how we can  easily create a new schema on MySQL workbench   we just right clicked here and created a new  schema you could have also used create schema   schema name command also which we just saw in  this video we will see how we can easily drop a   database on MySQL workbench after logging to mySQL  workbench you can see we created a midb database   to drop it you can straight away right  click here and click on drop schema   here it is asking that you want to permanently  delete the schema mid DB that is the database   DB or not yes I want to drop now I'll click  on drop now you can see it vanished so guys   you can see the query here you could have also  used drop database and the database name here and that's it so when we clicked on the button  drop schema it automatically executed the   following query and the query took around 0.281  seconds and we dropped the schema now the schema   is not visible amid DB here so guys in this  video we saw how we can quickly drop a schema   on my SQL workbench in this video we will learn  how we can export the data on MySQL workbench so   this is our database and the following is a sample  table to export go to server and click on export now let's see what it is I'll go  for the entire midb let's say okay   and Export to dumb project folder  I'll I'll just change the folder   so let's say I'll go to desktop  and herein I'll create a new folder this is a new folder I'll right click  and rename Amit DB backup let's say okay   now you can check the path amid DB backup   let's minimize and here it is backup it will be  empty because we have still not exported go here okay so here it is export to dumb project  folder which is fine so it will export the   entire mbdb with with the table that's it  here is the export progress will be visible   on clicking the database our table is visible if you want every table to be exported  to a separate file you can select this   but I'll just click here now  guys go to export progress and   click Start export let's see what  will happen folder already exists now you can see export is finished now I'll go minimize here and you can see our  export is visible in SQL format you can open it with notepad plus plus or  notepad also okay open it in any editor   here it is and herein you can see  uh the code all the entire table dump is visible we were only having a single  table so here is the actual command you can verify so guys in this way you can easily export data in  workbench thank you for watching the video in this   video we will learn how to easily import data in  MySQL workbench so let's say we have the following   database and we want to import a CSV file which is  on the desktop here it is we want to import this   data this is a CSV file so for that let's say I'll  just right click on tables okay and table data   import wizard I'll click on it but if you want  to import the record in the current Table only   you can right click and do this here okay I'll  do this and show all other things import wizard   you can easily import CSV Json data files we  have a CSV file so I'll just click on browse   go to desktop and just click  on open okay I'll now click   next here now do you want to import the data in  the current Table employee no I want to create a   new table so I will create a new table let's say  amp records I can also change the name let's say   EMP deck okay and the database is the same  amidb I'll click on next let's say if there's   an error or not no it worked so these are  the columns and these are the records in   the EMP records which is on the desktop so  this will import here that's it nothing else   and that too in a new table okay all the  records which is on the desktop EMP records   CSV file click next following task will not  be performed prepare import just click next finish performing task click next table Amit DB dot EMP Rec was created click finish   five records imported okay  and it was on the desktop okay now let's see where is our table  I'll click refresh and here is a record   okay sorry these are the columns what I'll do I'll just directly create select star from command sorry  select star from what is the name of our here it is and you can match this with our desktop which we just imported desktop CSV  file here it is you can match it it is same   so this is how we can easily import data in  MySQL workbench from a CSV file or Json file   we can import it in the current table or in  a new table thank you for watching the video   in this video we will learn how we can  easily export the result to a CSV file   so I just executed a query for my employee table  it is having four columns okay so I just want to   export the result so I just executed this and  the following is visible output I just want   this entire record to be exported to a CSV file  it's very easy Ali and you can see some rows are   visible some buttons are visible okay you just  need to click on export record set to an external   file now you can save it to desktop I'll name it  to my result it will convert it to CSV click save   now minimize click on my result.cv herein you  can see your record is visible so here it is   and you can compare this in this way you can  easily export this to an external file okay   that is your result thank you for watching  the video in this video we will learn how we   can easily save the script to a file so  let's say you have the following script   or you can also consider that you have a bunch  of scripts here which I've executed and you want   to save it for future use okay that is kind of  backup for the commands so you can easily save it   by clicking the save the script to a file now you  can navigate to the desktop go create a folder or you can say backup commands I'll go  inside it and I'll save it to let's say   the name is amit.sql it will take the  format SQL on soon okay and click save   now I'll open it here it is my backup commands  now we'll be having amid.sql I'll right click let's say I'll open it with the notepad or notepad  plus plus let's say Notepad and herein you can   see your command so let's say you have a bunch  of commands here I told you it will be it will   get saved here it will get saved like this okay  right now we only have a single command to show   but if you have a lot of command then this is  really useful thank you for watching the video   in this video we will learn how we can save  how we can open a script file so let's say   you have a bunch of SQL commands and you  want to directly run it here without typing   it so you have it in a SQL file or even a text  file you can convert the text file to SQL file   using this under the query open a script file  in this editor and just implement it for that   what you can do you can directly click here  open a script file in this editor and let's   say on the desktop itself we have our Command  I'll just click on open and all the commands   all the commands will open here here it is  now you can directly change it or you can   execute them one by one okay in this way if you  have a backup of your previous command you can   easily execute them here again using this open a  script file in this editor thank you for watching   the video in this video we will see how we  can limit the number of rows while you are   querying on MySQL workbench software login you  can see the query section is visible the first   option you can use is by clicking here you  can limit and set it let's say I limit to 50   000 rows I have limited it now let's  say you want another option another way   for that go to query and here it is limit rows and  you can just set the number of limits 2000 rows   let's say so guys in this small video we saw how  we can limit the number of rows on MySQL workbench   in this video we will learn how we can change the  font of the SQL editor on workbench so here is our   editor and you can see the size the font  size is really small or we can fix it go to edit click on preferences now here in go to fonts and colors and this  is the SQL editor it's only 10 I'll change   it to let's say 18 and I'll just click  on okay so let's see what will happen I'll close it I'll close it now I'll open it again now you can see now you can see we have changed it to 18 I'll just  show the output here it here is the output okay   so in this way you can change the font of your SQL  editor in this video we will learn how to easily   adjust the panels on my SQL workbench that is a  UI so let's say you want to remove these and these   panels how we can do that go to view go to panels  and click on hide sidebar so this is hidden now   again go to panels and click on hide  secondary sidebar this is hidden   the last hide output area this field this  is Now hidden now if you want to enable   all these you can go to view again and enable  or you can click here to enable it or disable   I'll click here again it will disable  and in the same way you can enable it   so guys in this video we saw how we can  easily work around the UI of workbench   and show a night panels and output  window thank you for watching the video   in this video we will learn how we can  search the table data in MySQL workbench   so let's say you have a table with the  more than 100 or more than thousand   records so how you can search for any value  text or number so here in let's say we have let's say we have an employee table okay so  I'll just right click on the table and click on and click search table data okay here in search for table field  let's say I want to search for   Tom okay search for table fields that  contains Tom okay simply I'll search it here and you can select maximum matches per  table or maximum total match you can change it   and you can search Columns of  all types so we have a small   data right now so I am just showing an  example click search click Start search   so it's visible under emit DB1 we have an  employee name Tom you can verify it here so it was Tom select star  from employee I'll just search here it is Tom was here Tom was inside amidb   employee table so you can easily search  around tables thank you for watching the video in this video we will learn how we can clear  the output window on workbench so we executed   two commands the following command resulted  in the following okay and here is the output   window okay result and output window different  so whenever you'll execute any command this   output window will completely get occupied okay  right now we have only two commands so this will   give you a message a positive message a correct  message that your query executed successfully   okay so you want to clear this or you  can or you can do that this will also   show you the timestamp right click and just  click on clear that's it okay so I'll just right click and click clear that's it so guys in  this way we can easily clear the output window   and workbench thank you for watching the video  in this video we will learn how we can easily   create a new user on MySQL workbench currently  we have a single admin user root so after opening   workbench here in administration and schemas are  visible since you want to create a new user so   you will click on Administration here in click  on users and privileges now you can see our root   password is visible a root user is visible which  we created while installing it okay we also set a   password now we can click on add account to add  a new account new user let's say I'll name it   Vaibhav authentication remember what was there  so I'll do the same now I'll add a password enter your own password and click on apply Okay click on apply so we have created a new user so guys in this video we saw how  we can easily create a new user   thank you for watching the video in this video  we will learn how we can set the count limits and   assign administrative roles to a user we just  created a user web Hub and that's it here it   is on localhost and we added a password so under  user and privileges only click on account limits   so if you want to restrict the user even  if it's a new admin to a number of queries   maximum queries you can restrict it here let's  say you want the web user to only run maximum   100 queries in one hour so this is visible  here and if you also want to set the limit for   connecting to the server in an R you can set  it here let's see this so this is how in the   admin you can control so this is how you  can control any user being the root user   and click on apply okay you can also set  administrative roles if you want to set him   as a I told you if you want to if you want a new  admin you can select all the roles all and provide   all the Privileges here if you want to disallow  drop and delete you can select all of them   okay but uncheck drop and delete so that  so that the new user won't be able to   delete or drop a table or database this is  really important if you are the admin if   you are the database administrator okay so you  can select rest of them and just click on apply   so in this video we saw how we can set the  count limits and administrative roles and   assign administrative roles to a user on MySQL  workbench thank you for watching the video   in this video we will learn how we can easily  reset the admin password under MySQL workbench so   I just logged in so to set the password go to  users and Privileges and you will be able to see   the CR users so we have our web of and root user  rest three of them were provided by my second only   okay so here is the root password  you can change the password from here   okay so you can set the password  here let's say I will set it click apply that's it we have set it now you can  click refresh and you can also click   close here let's say I'll open it again workbench click here and you need to  now add the new password root so we logged in using the new password  so guys in this video we saw how we can   reset a password for the admin user  thank you for watching the video
Info
Channel: Amit Thinks
Views: 37,318
Rating: undefined out of 5
Keywords: mysql workbench, workbench tutorial, learn workbench, workbench course, create a database in workbench, create a table in workbench, creat a schema in workbench, how to, workbench mysql download, workbench mysql tutorial, mysql workbench tutorial, 2023, amit thinks, mysql workbench create database, mysql workbench installation, mysql workbench download, setup mysql workbench, what is mysql workbench, mysql workbench install, mysql workbench tutorial for beginners, studyopedia
Id: UzodkZUt5JY
Channel Id: undefined
Length: 39min 48sec (2388 seconds)
Published: Wed Aug 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.