Яндекс.Метрика
qr-код - Как-то так стрелка - Как-то так
Leading Economist + ... пиктограмма - Как-то Так THIS     Economic literacy and web solutions
Персональная помощь в бизнес-планировании,
финансово-экономическом моделировании и разработке CRM-систем 👉 telegram
Turn your quality WITH ME - BUTW !
If you don't like what you get, change what you give. © Carlos Castaneda     KAKTOTAK.BY - economic design and web development services (php/js - telegram, WordPress, Laravel, Vue, SEO)    Cooperation - on an ongoing basis    Be in the topic   -    SUBSCRIBE      My notes are ECONOMICS +  и  WEB Developer's Guide | php+js+seo   в Telegram   telegram  

How to connect the Navicat graphics client to the MySQL server on WSL and solve error 1251

How to connect the Navicat graphics client to the MySQL server on WSL and solve error 1251

Familiar work with databases through a graphical interface often pushes developers away from using the Ubuntu environment, especially in the case of WSL (Windows Subsystem for Linux). However, as it turned out, connecting a graphical client (for example, Navicat) to work with a database on a MySQL server deployed in WSL is quite simple and does not require complex manipulations.

In this short guide, you will learn how to configure the MySQL server and fix the error "1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client" to ensure a successful connection via the Navicat graphical client.

Step 1: Configuring MySQL on WSL

Make sure MySQL is installed and running

If MySQL is not already installed, run the following commands in WSL to install and run it:

sudo apt update
sudo apt install mysql-server
sudo service mysql start

After launching, check its operation:

sudo service mysql status

Step 2: Allow connections from other devices

By default, the MySQL server listens only to local connections (via 127.0.0.1). To connect from Navicat (or other Windows programs), you need to change this behavior:

  • Open the MySQL configuration file:
  • sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
  • Find the bind-address setting:

    It will look something like this:

    bind-address = 127.0.0.1
  • Change it to the following:
    bind-address = 0.0.0.0
  • Save the file and restart MySQL:
    sudo service mysql restart

Step 3: Configure MySQL User for Remote Connections

By default, in MySQL, the root user can only connect locally. To allow connection from Navicat, follow these steps:

  • Log in to MySQL:
  • sudo mysql -u root
  • Check the authentication methods and existing users:
  • SELECT host, user, plugin FROM mysql.user;
  • Change the user authentication method root to a compatible one:
  • ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '';
    FLUSH PRIVILEGES;
    
  • Make sure that the changes are applied:
  • SELECT host, user, plugin FROM mysql.user WHERE user = 'root';
  • Log out of MySQL:
  • EXIT;

Step 4: Find the WSL IP address

To connect via TCP/IP from Windows, we need an IP address assigned by WSL:

ip addr show

Find the IP address of the interface eth0. Example:

inet 172.24.239.136/20 brd 172.24.255.255 scope global eth0

Here is the WSL IP address: 172.24.239.136.

Step 5: Allow port 3306

To connect from the outside, you need to allow access to the MySQL port (3306):

  • If the WSL firewall (ufw) is enabled, run:
  • sudo ufw allow 3306
  • Check the port availability on the Windows side (in the Powershell terminal):
  • Test-NetConnection -ComputerName 172.24.239.136 -Port 3306

If TcpTestSucceeded is True, access is allowed.

Step 6: Configure the connection in Navicat

Now you can set up a connection in Navicat:

  • Open Navicat.
  • Create a new connection by selecting ConnectionMySQL.
  • In the connection settings, specify:
    • Connection Name: any name, for example, MySQL WSL.
    • Host Name/IP Address: The IP address of your WSL (for example, 172.24.239.136).
    • Port: 3306.
    • User Name: root.
    • Password: leave it blank (or specify the password if it is set).
  • Click Test Connection.

The result

As a result, we have user settings in MySQL Wsl for remote connections:

database synchronization on WSL with Windows - 1

Synchronize MySQL on Ubuntu with Navicate on Windows:

database synchronization on WSL with Windows - 2

Access to the IP and the corresponding WSL port from Windows:

database synchronization on WSL with Windows - 3

Solution to the problem with authentication of existing users (error - 1251 - Client does not support authentication protocol requested by server):

database synchronization on WSL with Windows - 4

It only remains to register the following path in the configuration of our database in the project:

database synchronization on WSL with Windows - 5

Now you can manage your databases on MySQL installed in WSL through the user-friendly Navicat interface!

автор - Михаленко Р.
M R. Автор - kaktotak.by Specialization: financial and economic design - modeling of business, investment projects of the real sector, analysis and evaluation of efficiency, optimization of the management decision system.

A wide range of web-based competencies for solving business problems.

Subscribe to my telegram channel - My notes are ECONOMICS +
Там я ничего не втюхиваю и не навязываю. Просто делюсь полезной информацией по экономической грамотности. Повышайте своё качество вместе со мной: что, как и почему в экономике на простом языке. Понятия, алгоритмы, процессы, микро- и макроаспекты и многое другое. Может, будет интересно !

And also - WEB Developer's Guide | php+js+seo
Notes and native solutions to simple local tasks in PHP, JS. Something about Laravel, WordPress, Vue and SEO.

  Personal assistance in economic design and web development:

  • Financial and economic modeling, analysis, accounting, business planning
  • Comprehensive web development/project support on the web (php/js, seo – Laravel, WordPress, Vue, telegram, administration, content, advertising in Yandex Direct

  telegram или форма обратной связи

Administrator
119
0
Name
E-mail
Rating
Review

Currency Converter
RUB RUB-icon
USD USD-icon
EUR EUR-icon
CNY CNY-icon
BYN BYN-icon
UAH UAH-icon
KZT KZT-icon
SHORT- what is it about
ECONOMIC LITERACY
  Simple online solutions to problems of economics and finance  
I Want To Know Everything. Useful Tips