Linux virtual machine: VMware + Ubuntu 16.04.4 Windows native: Navicat for MySQL 1. Download and install MySQL in the virtual machine To download and install VMware and Ubuntu 16.04.4, please search on Baidu. This article assumes that these have been installed. In the virtual machine, press Ctrl+Alt+T to open a terminal, enter the command sudo apt-get install mysql-server mysql-client , and then follow the prompts. Wait for the installation to complete. You can enter the command: whereis mysql to view the installation location of mysql Start the database command: service mysql start Close the database command: service mysql stop Restart the database command: service mysql restart Log in to the database: mysql -u root -p Authorize a new user (so that you don't need to log in to the database as root) mysql>grant all privileges on . to “new user name”@"%" identified by “new user password” with grant option; Changes take effect: myssql> flush privileges; Exit the database: mysql>exit; However, the database cannot be connected using Navicat for MySQL at this time, and an error message will be reported. The error message is as follows (because the remote connection of the file has not been configured): 2. Modify the MySQL configuration file Enter the command in the terminal: sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf After entering the password, the configuration file is opened. You need to comment out bind-address=127.0.0.1, which becomes #bind-address=127.0.0.1 3. Download and install Navicat for MySQL on the Windows machine Navicat for MySQL download and installation by yourself Baidu, basically all the way to next 4. Establish a connection First, determine the virtual machine IP, enter the command in the terminal: ifconfig -a, where inet addr is the real IP, which needs to be entered in navicat for MySQL Select Connection, click MySQL, and give the connection a name of your own. If the above process does not work for you, please refer to a few points. Note: 1. The network adapter in the virtual machine should be in bridge mode, which can be changed in Virtual Machine -> Settings -> Network Adapter 2. Pay attention to the settings of the virtual machine firewall The above is the editor's introduction to how to access the MySQL database in the Linux virtual machine under the Windows environment. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Detailed explanation of how to use the Vue license plate input component
>>: Detailed explanation of Zabbix installation and deployment practices
This article example shares the specific code of ...
This article shares the installation tutorial of ...
After CentOS 7 is successfully installed, OpenJDK...
When we type a letter on the keyboard, how is it ...
As shown in the figure: Check port usage: sudo ne...
Table of contents Port-related concepts: Relation...
1. Introduction The telnet command is used to log...
Pull the image docker pull mysql View the complet...
Preface Students who learn JavaScript know that A...
Detailed example of database operation object mod...
This article uses vue, and adds mouse click event...
Using the internal function instr in MySQL can re...
Table of contents What are Refs 1. String type Re...
Nginx's configuration syntax is flexible and ...
Specific method: 1. Press [ win+r ] to open the r...