Because I haven’t used mysql under Windows for a long time, now there are many options, and sqLYog connection always appears 1045 error, so I install mysql under VIRTUAL machine Ubuntu for access, but I want to use VScode under Win for development. The idea was to access VirtualBox’s mysql service on Windows.
1. Configure Virtualbox
Change mysql user Settings
GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘123’ WITH GRANTOPTION; Change user access IP permission to root using 123 to connect to mysql server from any host.
3. Modify mysql configuration
In the/etc/mysql/mysql. Conf. D/mysqld. CNF will bind – address = 127.0.0.1 annotations
4. Connect to the database
Const sequelize = new sequelize (' mysql: / / root: 123 @192.168.56.1:3306 / mydb '); // Use host-only to set the IP address