Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use VScode to connect virtual machine MySQL in window environment

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will introduce in detail "how to use VScode to connect virtual machine MySQL in window environment", the content steps are clear and detailed, and the details are handled properly, and the editor updates different knowledge points every day. I hope this article "how to use VScode to connect virtual machine MySQL in window environment" can give you unexpected gains, please follow the editor's ideas slowly in depth, the specific content is as follows, to harvest new knowledge.

What is the use of vscode Visual Studio Code is a cross-platform editor for writing modern web and cloud applications, which runs on OS X web Windows and Linux. It provides developers with built-in support for a variety of programming languages, and as Microsoft pointed out in keynote at the Build conference, this editor also provides rich code completion and navigation features for these languages.

one。 Virtual machine end

1. Find the configuration file for mysql

: sudo vim / etc/mysql/mysql.conf.d/mysqld.cnf

Press the "I" key to enter edit mode, find the following, and change the address to "0.0.0.0"

Restart the mysql service

: sudo vim / etc/mysql/mysql.conf.d/mysqld.cnf

two。 Connect MySQL

: mysql-uroot-hlocalhost-p

Enter the code and enter and prompt for the database password

3. Authorize the user

> > grant all privileges on *. * to 'username'@'%' identified by' password' with grant option

Can be a root user

4. Refresh authorization

> > flush privileges

II. Windows side

1. Open VScode and install the following two plug-ins

So there is this in VScode.

two。 You can now connect to the mysql database

2.1 enter the IP address of the virtual machine

If you don't know, you can use the following instructions to query.

: ifconfig

2.2 enter user name and password (user and password previously authorized on the virtual machine side)

2.3 output port number (default 3306)

2.4 this item can be entered without entering and enter directly.

At this point, you can see that VScode is connected to the mysql database on the virtual machine

If you can read this, the editor hopes that you will have the most profound experience from the practical level on the key issue of "how to use VScode to connect virtual machine MySQL in window environment". If you want to read more related articles, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report