Mysql workbench ошибка unable to connect to localhost

I just installed MySQL Workbench and there are no connections available for my localhost server. When I try to make one, I get an error popup. Has anyone experienced something like this before and would be able to help me out?

Here is what it looks like on start up:

MySQL home page

And if I try to make a connection myself it shows this:
enter image description here

Any help would be much appreciated — thanks!

Anil's user avatar

Anil

2,5396 gold badges33 silver badges42 bronze badges

asked Dec 6, 2013 at 18:55

scapegoat17's user avatar

scapegoat17scapegoat17

5,48914 gold badges54 silver badges90 bronze badges

3

Sounds like you only installed the MySQL Client Tools (MySQL Workbench). You have to install the MySQL Database server, configure and start it.

http://dev.mysql.com/downloads/

You probably want the MySQL Community Server download.

answered Dec 6, 2013 at 19:02

James Smith's user avatar

5

For Win users:

Check if the MYSQL service is running or not. To check the service is running or not. Use the below steps:

  • Step1: Open the Services Desktop app from the Windows menu.

enter image description here

  • Step 2: Then search the list of services to identify the name of the
    MySQL service.
    enter image description here
  • Step 3: Right-click on the service name to open the menu.
  • Step 4: Start the service if it is not running.

ino's user avatar

ino

2,3151 gold badge15 silver badges27 bronze badges

answered Jan 30, 2022 at 10:45

Chitransh Agarwal's user avatar

4

Solution:

  1. Open up your mysql installer.
  2. Click on Reconfigure, shown in red. https://i.stack.imgur.com/FUYnk.jpg
  3. In that, Click on next until you enter the Accounts and Roles tab.
  4. Create a password and then, click next for the rest of the tabs.

Now, try again!👍

ino's user avatar

ino

2,3151 gold badge15 silver badges27 bronze badges

answered Apr 16, 2021 at 6:14

MassDev's user avatar

Its Worked for me on Windows

First i installed and started XAMPP Control Panel
enter image description here

Clicked for Start under Actions for MySQL. And below is my Configuration for MySQL (MySQL Workbench 8.0 CE) Connections
enter image description here
And it got connected with Test DataBase

answered Apr 1, 2019 at 7:41

Dharmendra Prajapati's user avatar

If xamp already installed on your computer user these settings

enter image description here

answered Dec 17, 2014 at 6:10

UMAIR ALI's user avatar

UMAIR ALIUMAIR ALI

1,0455 gold badges14 silver badges25 bronze badges

1

I had this problem and I just realized that if in the server you see the user in the menu SERVER -> USERS AND PRIVILEGES and find the user who has % as HOSTNAME, you can use it instead the root user.

That’s all

answered Apr 23, 2015 at 16:33

user4825230's user avatar

enter image description here

I think you want to config your database server firstly after the installation, as shown in picture, you can reconfigure MySql server

answered Jan 28, 2021 at 20:45

hossam ibrahem's user avatar

  1. Install MySQL installer.
  2. Select Add… from the right side and install the latest version of MySQL server.

I hope this will work. It worked for me. Thank You.

answered Nov 2, 2022 at 21:13

Manthan Kurhekar's user avatar

1

services->mysql (on left corner click on start)

answered Jun 18 at 9:40

Rahul Raj's user avatar

New contributor

Rahul Raj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

if you are using localhost database, try port 3306

answered Apr 1, 2018 at 16:08

ContexDev's user avatar

1

MySQL Workbench could not connect to MySQL

MySQL Database (Db) is a database service that runs on a Local Server and on the Web. It is ideal for both small and large applications and it uses the standard SQL language. MySQL is free to download and use and has the most comprehensive set of advanced features, management tools, and technical support to achieve the highest levels of MySQL scalability, security, reliability, and uptime. The data in a MySQL database are stored in tables. A table is a collection of related data, and it consists of columns and rows, and the Db is useful for storing information categorically. This article, you will learn how to fix MySQL Workbench could not connect to MySQL server on the localhost 10061. In this article, you will learn how to fix ‘MySQL Workbench could not connect to MySQL server”

Note: It is worth noting that by default, the MySQL server listens for connections only from localhost. Which means it can be accessed only by applications running on the same host. But in production environments, you can allow remote access to the MySQL server.  

In this aspect, you will have to configure the MySQL server to listen on a specific IP address. Or all IP addresses on the server. See the following guides on MySQL. How to reset Mysql Root password, how to access MySQL Server from command Prompt, how to create and delete MySQL database, and how to migrate Veeam MsSQL Database to a new MsSQL Server.

This article shows the steps to resolve connection issues to MySQL Servers. See how to install Microsoft SQL Server 2019 and MsSQL Command line tools on Ubuntu Linux, how to uninstall Microsoft SQL Server on Windows 10 and Windows Server, and how to download and install Microsoft SQL Server 2019 Developer Edition and Microsoft SQL Server Management Studio on Windows 10 and Windows Server.

This error is shown in because the application was unable to connect to the MySQL server. There could be a number of reasons. But in my case, it was because the service was stopped and the service was not running. To fix this issue, kindly follow the steps below.

Launch MySQL Workbench to open the home screen. Existing connections are shown when you click the MySQL Connections view from the sidebar. No connections exist for first-time users.

Launch MySQL Workbench

Click on the Server Menu and click on Startup/Shutdown option as shown below

This will open up the Administration -Startup/Shutdown window. Click on Start Server

Accept the UAC. Next, you will be required to enter your password in order to start the database server. Enter your password and click on OK.

From the Administration, the Startup/Shutdown window, you should see the server is now running. And on this window, you can stop or take the server offline.

As you can see, the MySQL service is also running. And this is all that is needed to resolve this connection issue.

I hope you found this blog post helpful. You have learned how to fix the following error “MySQL Workbench could not connect to MySQL server on the localhost 10061”. If you have any questions, please let me know in the comment session.

My MySQL Workbench is not connecting to my local host, and I cannot figure out why exactly it is reacting like this. It just started doing this one day, and randomly it will give me access although it says it is still «unknown», but I am tired of this and would like to fix it.

Since this website reqires that I have a «10» reputation to post images, I will have to describe it.

On the Startup/Shutdown tab in the administration page, it says:

The database server instance is unknown. —The «Start Server» button is faded out so that I cannot click it.

Startup Message Log
2013-07-11 08:57:51 — Workbench will use cmd shell commands to start/stop this instance

2013-07-11 08:57:51 — Status check of service ‘MySQL’ returned error: Not found

2013-07-11 08:57:51 — Status check of service ‘MySQL’ returned error: Not found

2013-07-11 09:00:55 — Status check of service ‘MySQL’ returned error: Not found

2013-07-11 09:00:55 — Status check of service ‘MySQL’ returned error: Not found

2013-07-11 09:02:01 — Status check of service ‘MySQL’ returned error: Not found

Then on the server status tab in the administration page, it says:

Name: mysqld@localhost
host: localhost
server:unknown
status: unknown

Connection
There is no connection to the MySQL server. This functionality requires an established connection to a running MySQL server to work.

If anyone can help out, that would be great!

Thanks

Oracle website seems to imply it only works on 15 and 14.
http://dev.mysql.com/downloads/workbench/

Also two of my Ubuntu 16.04 machines don’t seem to be able to connect (Access is Denied errors for root)

Picture

It installs okay. It opens okay. But it won’t connect to localhost.

Anyone have any luck?

asked May 16, 2016 at 23:34

Jonathan's user avatar

JonathanJonathan

3,7644 gold badges28 silver badges49 bronze badges

5

The issue is likely due to socket authentication being enabled for the root user by default when no password is set, during the upgrade to 16.04. This important caveat is documented in the 16.04 release notes:

Password behaviour when the MySQL root password is empty has changed.
Packaging now enables socket authentication when the MySQL root
password is empty. This means that a non-root user can’t log in as the
MySQL root user with an empty password.

For whatever reason, the MySQL Workbench that came with 16.04 doesn’t work out of the box with MySQL server, at least for me. I tried using «Local Socket/Pipe» to connect in a number of different ways but to no avail.

The solution is to revert back to native password authentication. You can do this by logging in to MySQL using socket authentication by doing:

sudo mysql -u root

Once logged in:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

which will revert back to the native (old default) password authentication. If you’ve attempted some other method to fix the issue, you’ll want to make sure the «plugin» field in mysql.user is set to «auth_token», which may require using mysqld_safe to log in to MySQL in the event you’ve been tinketing with things, like I did.

Credit to Miguel Nieto’s blog post for this solution.

answered Jun 3, 2016 at 1:46

Mike M's user avatar

Mike MMike M

6114 silver badges2 bronze badges

6

MySQL 5.7 and up don’t support connecting as «root» in mysql-workbench so you must create a normal user and connect via that.

sudo mysql -u root -p

Create a user named «admin» and use that to connect in mysql-workbench.

CREATE USER 'admin'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;

answered Jul 1, 2016 at 21:55

Jonathan's user avatar

JonathanJonathan

3,7644 gold badges28 silver badges49 bronze badges

6

This question might be two years old but my work with mysql-workbench tonight seems to have given me the answer to it.

root user now users auth_socket authentication by default. The only way root can gain access is by being logged in as root.

I found this out by running mysql -u root both as root user and standard user.

It would not work under standard user.

So my next question was — what user does mysql-workbench run as. Turns out it runs as standard user by default. To get it to run as root user it has to be run from root. So I went into root user CLI and type ‘mysql-workbench’.

I then had to go into the settings for the root user as shown here. The file location is valid for an ubuntu 18.04 installation.

Root connection settings mysql-workbench.

If that socket location is invalid then you’ll need to go into the mysql CLI from root or sudo and run the following command.

MySQL CLI command to find the socket.

After you have the correct settings test the connection. It should be successful and you’re ready to go.

abu_bua's user avatar

abu_bua

10.4k10 gold badges43 silver badges62 bronze badges

answered Sep 26, 2018 at 14:36

George Tasker's user avatar

3

Create an user account with appropriate administrative privileges that can connect via mysql workbench using the auth_socket plugin. Note that this does not work for root connections to the mysql server.

Logon to mysql from a terminal session:

$sudo mysql

If you are able to do this then the auth_socket plugin is enabled and the root account is authenticating using this plugin. Note that this is the default setup when installing mysql on ubuntu after having run the secure installation script.

First create a mysql user for your account ‘valerie’:

mysql> CREATE USER 'valerie'@'localhost' IDENTIFIED WITH auth_socket;

Enable administrative privileges for the account:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'valerie'@'localhost' WITH GRANT OPTION;

Exit the shell:

mysql> exit

Then in mysql workbench:

  1. Create a new connection
  2. Select the connection method as Local Socket/Pipe
  3. Set the Socket/Pipe Path to: /var/run/mysqld/mysqld.sock (note that this is the path for a Debian / Ubuntu system and changes for other flavors of Linux)
  4. Set the username (‘valerie’ in this example)

You should be able to then connect to the mysql server with this connection.

answered Aug 19, 2018 at 4:31

David's user avatar

DavidDavid

311 bronze badge

Try this

select mysql database

use mysql;
UPDATE user set plugin='mysql_native_password' where User='root';
flush privileges;
exit;

Then

sudo service mysql restart

zx485's user avatar

zx485

2,22311 gold badges24 silver badges32 bronze badges

answered Jul 21, 2019 at 20:25

URI's user avatar

Open terminal of your ubuntu system and enter below code,

In my ubuntu 20.04 os system it works fine, able to enter password and workbeanch working fine.

sudo snap connect mysql-workbench-community:password-manager-service :password-manager-service

answered Jun 20, 2022 at 17:45

Daxesh Prajapati's user avatar

2

Works fine for me and I did nothing special. Installed mysql-server-5.7 and workbench both from command line and set up a user with a password and set up the normal database permissions (also with the normal method).

enter image description here

And with a database and table:

enter image description here

answered May 18, 2016 at 20:01

Rinzwind's user avatar

RinzwindRinzwind

292k41 gold badges566 silver badges707 bronze badges

1

If you are getting this error in Workbench then follow this steps.

First simply log in with your current password:

sudo mysql -u root -p

Then change your password because having low strength password gives error sometimes.

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new-strong-password';

FLUSH PRIVILEGES;

Then simply exit and again login with your new password:

quit

sudo mysql -u root -p

Once you successfully logged in type the command:

use mysql;

It should show a message like ‘Database changed’ then type:

UPDATE user SET plugin='mysql_native_password' WHERE User='root';

After that type:

UPDATE mysql.user set authentication_string=PASSWORD('new-strong-password') where user='root';

Then type:

FLUSH PRIVILEGES;

Then simply exit:

quit

Now try to log in with your new password in your WORKBENCH. Hope it will work. Thank you.

answered Apr 17, 2020 at 16:52

Tanmoy Bhowmick's user avatar

1

I had the same problem on newly installed 21.04 Ubuntu, after trying all these methods that didn’t quite work.

I tried to go into settings and allowed all the permissions and it worked for some reason.

Screenshot of the mysql setting

Greenonline's user avatar

Greenonline

2,0108 gold badges20 silver badges27 bronze badges

answered Oct 12, 2021 at 10:43

Keith John Smith's user avatar

2

MySQL server on AWS host running Ubuntu 16.04; mysql-workbench on Ubuntu 16.04 laptop; uses KeyPair connection.

After setting up Test db connection was working.
But the actual connection always failed with a message like the one posted by Jonathan Leaders.
Checked the log at ~/.mysql/workbench/log and found a few «permission denied» messages.

Now I can get mysql-workbench to work with:
sudo mysql-workbench

And later I can go and chmod the directories needing permission.

Kevin Bowen's user avatar

Kevin Bowen

19.3k55 gold badges76 silver badges81 bronze badges

answered Mar 4, 2017 at 7:22

Usman Suleman's user avatar

1

I ran this command and it fixed my issue:

sudo snap connect mysql-workbench-community:password-manager-service :password-manager-service

Thanks to Jos for his answer here

answered Nov 16, 2021 at 16:05

Al Fahad's user avatar

Al FahadAl Fahad

2631 gold badge2 silver badges10 bronze badges


Go to mysql


r/mysql

Discussion of MySQL and assistance for MySQL related questions




Members





Online



MySQL Workbench: «Cannot connect to localhost» when trying to connect remote

I’m trying to connect to my MySQL server, which is sitting at home, having a static ip, from school using MySQL Workbench. So no localhost connection. When I put in all the right credentials and try to connect to the user that I set up for the job and runs with %
as host. I also already edited bind
to be 0.0.0.0
in the MySQL config. When I now try and connect, I get this: Error when trying to connect

What am I missing?

  • Mysql workbench ошибка 1452
  • Mysql workbench ошибка 1064
  • Mysql server ошибка установки
  • Mysql server ошибка при установке
  • Mysql num rows ошибка