(base) jain@jain-ThinkPad-T440s:~$ sudo apt install mysql-workbench
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package mysql-workbench
This error means mysql-workbench is not available in your default APT sources, which is common in some Ubuntu derivatives or if the required universe repository isn't enabled.
I can then give you the exact .deb download link or instructions tailored to your distro.
(base) jain@jain-ThinkPad-T440s:~/Downloads$ sudo dpkg -i mysql-workbench-community_8.0.42-1ubuntu24.04_amd64.deb
Selecting previously unselected package mysql-workbench-community.
(Reading database ... 171412 files and directories currently installed.)
Preparing to unpack mysql-workbench-community_8.0.42-1ubuntu24.04_amd64.deb ...
Unpacking mysql-workbench-community (8.0.42-1ubuntu24.04) ...
dpkg: dependency problems prevent configuration of mysql-workbench-community:
mysql-workbench-community depends on libatkmm-1.6-1v5 (>= 2.28.4); however:
Package libatkmm-1.6-1v5 is not installed.
mysql-workbench-community depends on libglibmm-2.4-1t64 (>= 2.66.7); however:
Package libglibmm-2.4-1t64 is not installed.
mysql-workbench-community depends on libgtkmm-3.0-1t64 (>= 3.24.9); however:
Package libgtkmm-3.0-1t64 is not installed.
mysql-workbench-community depends on libmysqlclient21 (>= 8.0.11); however:
Package libmysqlclient21 is not installed.
mysql-workbench-community depends on libodbc2 (>= 2.3.1); however:
Package libodbc2 is not installed.
mysql-workbench-community depends on libproj25 (>= 9.4.0); however:
Package libproj25 is not installed.
mysql-workbench-community depends on libsigc++-2.0-0v5 (>= 2.8.0); however:
Package libsigc++-2.0-0v5 is not installed.
mysql-workbench-community depends on libzip4t64 (>= 0.10); however:
Package libzip4t64 is not installed.
dpkg: error processing package mysql-workbench-community (--install):
dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.36.0-1.1ubuntu3) ...
Processing triggers for desktop-file-utils (0.27-2build1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (2.4-4) ...
Errors were encountered while processing:
mysql-workbench-community
You're almost there! The error you're seeing is due to missing dependencies required by the .deb package. Fortunately, this is common and can be easily fixed using APT.
✅ Fix MySQL Workbench Installation
After running dpkg, follow up with this command to automatically install all the missing dependencies:
bash
sudo apt --fix-broken install
This will:
Fetch and install all the missing packages required
Complete the installation of MySQL Workbench
🧪 Then (optional): Verify installation
You can launch MySQL Workbench via:
bash
mysql-workbench
Or search for it in your application menu.
🛠If --fix-broken doesn’t work
You can manually install all missing dependencies listed:
The error in the screenshot means that MySQL Workbench (or a similar GUI tool) is unable to connect to your MySQL server using the root user at localhost:3306.
🔧 Cause:
The key issue is:
pgsql
Access denied foruser'root'@'localhost'
This means the root password is incorrect, or the root user is not allowed to log in via TCP/IP.
✅ Fix Steps
1. Make sure MySQL server is running
Run this in terminal:
bash
sudo systemctl status mysql
If it's not running, start it with:
bash
sudo systemctl start mysql
2. Try logging in from terminal
bash
sudo mysql -u root
If this logs you in without a password, then root is configured with auth_socket plugin.
3. Switch root to use password-based login (optional)
If you want to log in via Workbench, you'll need to allow password authentication:
sql
ALTERUSER'root'@'localhost' IDENTIFIED WITH mysql_native_password BY'yourpassword';
FLUSH PRIVILEGES;
Then, test:
bash
mysql -u root -p
4. Use correct credentials in MySQL Workbench
Host: 127.0.0.1
Port: 3306
Username: root
Password: the one you set above
✅ Avoid using localhost — use 127.0.0.1 to force TCP/IP.
Let me know if you want to create a new MySQL user instead of changing root.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pass';
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
(base) jain@jain-ThinkPad-T440s:~/Downloads$ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
You're now getting:
vbnet
ERROR2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
This error means MySQL server is not running, or the socket file is not available at /tmp/mysql.sock, which is where your client expects it.
✅ Step-by-Step Fix
1. Start MySQL Server
Run:
bash
sudo systemctl start mysql
If it gives:
System has not been booted with systemd as init system
You're likely on a system like MX Linux, which uses SysVinit or runit instead of systemd.
So try:
bash
sudo service mysql start
Then test:
bash
sudo service mysql status
2. Verify Socket Location (Optional)
Check where the MySQL socket is configured:
bash
mysqladmin variables | grep socket
Or:
bash
sudo cat /etc/mysql/my.cnf | grep socket
You might see:
perl
socket = /var/run/mysqld/mysqld.sock
If so, connect using:
bash
mysql -u root -p --socket=/var/run/mysqld/mysqld.sock