MySQL in VSCode | How to Run SQL in VS Code | Connect MySQL in Visual Studio Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome to my Channel today in this video tutorial we will learn how to connect to myscale database and visual studio code and run queries and visual studio core so let's start so we needed an extension to connect to mySQL database so we will go to this extension Tab and here I'll search for MySQL we will download and install the second one by when Chen install this and here the detail is given how the pictures works and how can it be installed and how you can connect it to your database so now the extension is installed so I'll close this and I'll close this as well now you can see these two icons here on this icon you can connect to database here you can see create connection button you can also connect with this plus but but before connecting here we will go to workbench and I will show you the databases so work connect to root the password is root and you can see we here we have the system database and we have two user defined databases demo and test now we will connect so I'll close this so we will create a connection here so from here we can connect to our mySQL database so here is the connection name you can give it any name and now if we go down here this is the host name which is localhost 127.0.0.1 is localhost and this is the default Port which MySQL is using 3306 if you have changed your Port you will use that here and this is the username of our database server and this is the password of our server so here we are using root username and we are using root password so I'll use root here and here you can mention a specific database to which you want to connect but we won't mention any database here if I click on this connect so it will automatically connect as you can see here it has connected so now if I expand this you can see the demo and the test the user find databases that we have created or that was already created in MySQL so now I can add a database here so to add a database here I'll click on this plus button and it has given me this query of create database so here I can give my database name so I'll name this test DB and now I'll come here as you can see and execute button Above This create I'll click on this and effect it rows 1 and you can see test DB here we will expand this test DB now if I expand this you can see here tables but we do not have any table inside this so I'll add in a table so I'll click on this plus button and it will create me a createable query now I'll change this table name to STD underscore TBL and I'll remove this column and then we have name car and then I'll put a comma here and father name worker 255 comma and then address 255 and I'll remove this comment and this and now if I execute this I'll come to this execute button Above This create and click on this and it will execute this queue if I expand the tables you can see this TD table here we want to add some records into this STD table so for that I will right click on this table and I'll come to this cable template and I'll come to this answer template so it will create an insert query for us we will provide the values here and this second brackets the first one is ID so I will provide one and then is the name so it is work or value so we will put it in single quotes single quotes and I'll name this uh tanvir and then father name chords and I'll use on and then address so for address I will use a picture so now this query is complete I have to go to top and here we have this execute button so if I click on this execute so you can see that one row affected so now if I right click on this table STD table SQL template and select template so as you can see here it has created a I select query below this insert query so now if I execute this now you can see that one record which we have inserted now if I make this two and if I make this uh Ali and now if I execute this again and now if I go down and execute this query so now you can see that as you can record is inserted as well so in this way you can insert an uh retrieve or select records I prompt your schedule table if I want to drop this table or want to truncate this table so I'll right click on this table and now if I come first I will truncate this now if I come to this truncate table and click on this so it will ask me if you want to truncate this table so if I click on this yes so it will truncate the table now if I execute this salary query now you can see we do not have any record now if I want to delete or to drop this table so I'll right click on this and drop this table it will ask me or you want to draw table yes and it will drop the table similarly you can drop the database as well so I'll right click on this and I'll come to this drop and it will ask me to insert the database name that you want to draw so I'll test DB and hit enter the database is Brock so in this way you can connect to mySQL database in Visual Studio code and run queries and create databases and tables so I think that's all for today I hope you like the video if you like the video please like subscribe and comment
Info
Channel: Programming Guru
Views: 7,615
Rating: undefined out of 5
Keywords: mysql in vscode, how to run sql in vs code, mysql vscode, sql in vs code, sql in vscode, mysql visual studio code, vscode mysql, how to run sql in vscode, mysql in vs code, mysql vs code, how to use sql in vs code, mysql on vscode, how to use mysql in vscode, how to connect visual studio code to database, install mysql, vscode sql, how to install mysql connector in visual studio code, how to run sql, my sql in vs code, mysql, mysql for visual studio code
Id: DvloLXIrzaU
Channel Id: undefined
Length: 5min 11sec (311 seconds)
Published: Wed Oct 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.