How to Connect MySQL Database from Visual Studio Code | SQLTools Extension Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone today we are going to see how we can connect mySQL database with Visual Studio code and we are going to perform some queries in Visual Studio code as well so let's see how we can do this awesome stuff so first of all open your favorite uh browser if you want because we want to download one extension but here I'm just going to open the visual studio code okay so this is my visual studio code I'm just going to click on the extensions and I am searching for extension of SQL tool so you just search for SQL and you can see SQL tool extension is available and you can see it's almost 2 million people downloaded two or three million people downloaded the SQL tools extension okay so just hit and it's also a good rated 4 star rating is available you can see uh the connectors for mariadb SQL Server MySQL tdb postgresql all popular databases the extensions are available okay and you can see as I install the SQL extension you can see on the side panel sidebar there is one database icon and you can see from this we are able to access and connect to our different databases so for this let's add a new connection and here you can see could not find any install drivers right so for it we have to install the specific drivers of the databases so in our case we are going to install mySQL database so that's why let's download this SQL tool MySQL mariadb and tdb Driver so I am just going to hit on the install button and you will see the driver is getting installed after that I am going to click on the database and click connect so you can see the driver for mariadb MySQL and tdb is available so we are going to connect with mySQL so just I am going to hit on the connect and as you know the driver here is the driver and we have installed the mySQL database already so if you want to see how we can install mySQL database in Windows so you can check my video so I will give the link in the description so let's provide some important things such as a server address so right now it's a local host so I'm providing localhost and the port number is 3306. that is by default Port of mySQL database after that we can provide username So currently I am going to login in this database as a root but you can provide username if you have already the users set up for the databases okay then you can see uh password modes are available so it's just the different kinds of connections or like authentication methods available so I am just going with the default one and you can see authentication password Okay so it's the default method available a for MySQL connector so I am going with it and you can see SSL is disabled keep it as it is if you want to change then you can but I suggest you keep it as it is and other parameters also we don't need to specify the one important parameter we need to provide here is we need to provide the database name ah it will create a connection for the specific databases okay so if I hit on the save connection so you can see it will throw error required field so I'm just going to provide the database name and the database name is World in my case so okay you can see the connection is set up successfully all right and the metadata related to that MySQL connection you can see here and in the right pin you can see the connection as well so hit on the connect and allow this Visual Studio code to connect the mySQL database with the help of the SQL tool driver and it will ask you for passwords so I am just going to provide my password also you can connect the your database through this connection pin right click and click on the connect so I am going to provide my password so you can see I have provided the password yeah okay and you can see database is connected and here the database SQL query script is here as well as you can see the databases are available so you can see World database is available there so this is the interface of your database connection so here you can see uh queries connections and all your database structure is available here so you can see I have cities database country City stable country table and uh country language stable so I'm just right click on City table and you can see here options such as show as table so I'm just going to hit on it and it will fire insert query and it will show all the cities available in the cities table okay okay let's create a simple query select count you can see it shows the auto suggestion star select count star from and table name is cities okay and just select this line and hit on the run so you can see total number of cities are nine thousand four thousand nine hundred and seventy nine cities are available so in this way we can set up the mySQL database connection thanks for watching this video and if you like this video content then don't forget to subscribe like and comment we will meet you in the next video till then Happy coding
Info
Channel: SkillSharp
Views: 932
Rating: undefined out of 5
Keywords: Visual Studio Code, MySQL database, SQLTools extension, Database management, SQL queries, Table structures, Database connection, Visual Studio Code tutorial, SQLTools tutorial, MySQL tutorial, Database management tutorial, Visual Studio Code extensions, Code editor, SQLTools configuration, Database connectivity, SQL query execution, Table management, Database administration, Software development, Data management, SkillSharp
Id: GydPwVLkY8k
Channel Id: undefined
Length: 6min 27sec (387 seconds)
Published: Sun Jul 02 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.