Kali(Ubuntu) MySQL virtual machine remote connection

Copyright statement: This article is the original article of the blogger and follows the CC 4.0 BY-SA copyright agreement. Please attach the original source link and this statement for reprinting.

Link to this article: https://blog.csdn.net/qq_37933685/article/details/80687280

Personal blog: https://suveng.github.io/blog/​​​​​​​

kali(Ubuntu) MySQL virtual machine remote connection#

I use the ova virtual machine image provided by the official kali. After it has been installed MySQL, what we often face is to use the client to connect remotely, and considering the security issues, we will not Use root user.

Therefore, the next step is to organize new users and authorize them to allow clients to log in and access.

1、 ubuntu connect to mysql database

  1. mysql -u root -p

Enter the root user password set during installation.

2、 Switch to mysql database

  1. mysql> use mysql;
  2. mysql> select host,user,password from user;
  3. 5.7 The above version mysql> select host,user,authentication_string from user;

3、 Authorize new users

  1. grant all privileges on . to ‘myuser’@’%’ identified by ‘root’ with grant option;
  2. mysql> flush privileges;

Note: (1) "%" wants to connect to this Mysql

The IP address of the client side of the database can be modified as required. % Means all ip can be connected

​ (2) password is the password of the Mysql database test user, which needs to be modified according to the actual situation

5、 Modify MySQL configuration file

/etc/mysql/my.cnf file, find bind-address = 127.0.0.1

Comment out the line bind-address = 127.0.0.1, that is, modify it to:

bind-address = 127.0.0.1

6、 Restart the MySQL service

  1. service mysql restart

7、 Use the connection tool to try to connect.

Recommended Posts

Kali(Ubuntu) MySQL virtual machine remote connection
Putty remote login VMware virtual machine Linux (Ubuntu12.04)
003.KVM virtual machine deployment-CentOS6.8
ubuntu remote connection 22 port
Remote connection to Ubuntu 19.1
Install ubuntu on virtual machine
Ubuntu14.04 creates Genymotion virtual machine
Linux CentOS 7 virtual machine clone
VMwareWorkstation10.0 install CentOS7.0 virtual machine
Virtual machine VirtualBox-5.1 install ubuntu16.0.1
CentOS 6.8 virtual machine installation details