How to Connect to MySQL Server and Run SQL Queries from VSCode (2024) - MySQL in Visual Studio Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's see how we can connect to mySQL server from Visual Studio code and run queries on that MySQL server first open your Visual Studio code and click on this extensions or hit control shift X shortcut and your extensions will open now search for MySQL now you'll see a bunch of options I use this one this colorful one from Vision Shen click on this and click on install so as you can see it not only works for MySQL it also works for post gray SQ light red and elastic so now are MySQL client or extension is installed you can close this now you'll see these options so click on database this option now I already have a connection here but in your case it will not be there so you can just delete this let me just delete this so it will be like this initially right so you can click on create connection and let's say I just call it test connection and connection scope is global this that means that this connection will be available whenever you open any other project also so I'll just leave it like that and I'll leave the rest as it is so here are where you need to put your credentials so let's say you have a my server in some remote server so you need to enter that IP here for now I'll use the local database that I have local MyQ that I have in my local machine so I'm using this Local Host IP address the port is this this also if you have different port you can change Port here and the username is root also in my local database I don't have a password so I'll not enter any password here and yeah so you can choose to enter a database name here but for now I'll not enter anything now click on connect so as you can see the connection is Success so once the connection is Success you can click on save so that this database connection is saved so I'll click save now and the connection is saved so I can close this now and as you can see my test connection is shown here now I can just do this and as you can see there are two databases here tests and PHP my admin and inside test there are no tables at the moment as you can see no tables found and inside PHP my admin there are a bunch of tables so what you can do is click on this open query and you can query this database so I can do show tables and run this using run selected SQL or control enter so as you can see I don't have any tables so no none of the tables are shown so this is how you can connect to my SQL database and run queries against any database if you have any questions let me know in the comments below
Info
Channel: The Code City
Views: 1,144
Rating: undefined out of 5
Keywords: mysql server vscode, connect to mysql server vscode, mysql server visual studio code, connect to mysql server visual studio code, run mysql queries vscode, run sql queries vscode, run mysql in vscode
Id: zItEMdswiyg
Channel Id: undefined
Length: 3min 1sec (181 seconds)
Published: Sat Jan 13 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.