Mysql error 1524 hy000 plugin 0 is not loaded

Ответили на вопрос 4 человека. Оцените лучшие ответы! И подпишитесь на вопрос, чтобы узнавать о появлении новых ответов.
  • Diamond00744

Установил MySQL на Ubuntu 16.04 LTS при попытке входа:
>mysql -u root -p
Выводиться ошибка ERROR 1524 (HY000): Plugin ‘unix_socket’ is not loaded


  • Вопрос задан

    более трёх лет назад

  • 13469 просмотров

Нашел ответ в интернете: https://www.versatilewebsolutions.com/blog/2015/05…
Вкратце:
1.Находим файл конфигураций my.cnf в каталоге /etc/mysql/ , и редактируем его — добавляем в самом низу файла
[mysqld]
plugin-load-add = auth_socket.so

и сохраняем файл(С этим возникнут проблемы если делать это через Nautilus тем же geditом. В терминале можно ввести
gksu gedit /путь/к/папке/с_файлом/файл
предварительно выполнив sudo apt install gksu, если пакет gksu неустановлен, подробнее тут: https://losst.ru/kak-redaktirovat-fajly-v-ubuntu
2.Перезагружаем mysql командой
sudo systemctl restart mysql.service
3.Пробуем зайти в mysql без ввода пароля к mysql, вводим пароль только на требование системы(sudo)
sudo mysql -u root
После этих действий у меня все заработало!!!

Пригласить эксперта

Вышеописанное решение не помогло, ошибка та же что и у Владимир.

Система: Debian 9 Stretch [amd64]

Такая ошибка бывает при повреждении таблицы с пользователями.

Для исправления можно запустить mysql сервер в режиме без ограничений прав (& означает в фоновом режиме)
sudo mysqld_safe --skip-grant-tables &
Либо обычным запуском с параметром в my.ini

[mysqld]
skip-grant-tables

Можно подключаться без пароля
mysql -uroot
Обновляем пароль для root

use mysql
update user set password=PASSWORD("new_password") where user='root';

После этого можно запускать сервер в обычном режиме.


  • Показать ещё
    Загружается…

10 февр. 2023, в 00:54

2000 руб./в час

10 февр. 2023, в 00:15

1000 руб./в час

09 февр. 2023, в 22:06

500 руб./за проект

Минуточку внимания

Недавно я столкнулся с этой ошибкой «ERROR 1524 (HY000): Plugin ‘unix_socket’ is not loaded » на моем сервере Debian 9 при попытке аутентификации в базе данных MariaDB от имени пользователя root.

После некоторого поиска в Google я нашел способ обойти эту ошибку – запустить службу MySQL с mysqld_safe и сбросить пароль root.

Шаг 1: Остановить службу MySQL

Остановите службу MySQL.

$ sudo systemctl stop mysql
или
$ sudo /etc/init.d/mysql stop

Шаг 2: Запустите mysql с помощью mysqld_safe

Затем запустите службу mysql с mysqld_safe и параметром –skip-grant-tables он должен дальше работать в фоновом режиме.

$ sudo mysqld_safe --skip-grant-tables &
[1] 8197

Шаг 3: Сброс пароля пользователя root

Откройте консоль MySQL.

$ mysql -uroot
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 8
Server version: 10.3.14-MariaDB-1:10.3.14+maria~stretch mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]>

Вы должны добраться до терминала MySQL без аутентификации по паролю.

Теперь переключитесь на базу данных mysql.

MariaDB [(none)]> USE mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

Сбросьте пароль пользователя root.

MariaDB [mysql]> update user set password=PASSWORD("NewRootPassword") where User='root';
Query OK, 0 rows affected (0.002 sec)
Rows matched: 1  Changed: 0  Warnings: 0

Замените NewRootPassword своим новым паролем для пользователя root.

Также установите плагин аутентификации на native

MariaDB [mysql]> UPDATE USER SET plugin="mysql_native_password";
Query OK, 2 rows affected (0.001 sec)
Rows matched: 2  Changed: 2  Warnings: 0

Закройте сеанс базы данных.

MariaDB [mysql]> quit;
Bye

Шаг 4: Сброс пароля пользователя root

Перезапустите службу MySQL стандартным способом. Но сначала остановите сервис

$ sudo systemctl stop mysql
или
$ /etc/init.d/mysql stop

Убедитесь, что другой процесс не запущен.

ps aux | grep mysql

Запустите MySQL.

sudo systemctl start mysql

Проверьте доступ от имени пользователя root.

$ mysql -u root -p
Enter password: <Enter Password Set>
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 8
Server version: 10.3.14-MariaDB-1:10.3.14+maria~stretch mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MariaDB [(none)]> QUIT
Bye

Похожие статьи:

  • Как сбросить пароль root в MySQL и MariaDB?
  • Как сбросить пароль root в RHEL 8
  • Как сбросить пароль Kali Linux
  • Как сбросить пароль Linux для истечения срока действия после нескольких дней
  • Как сбросить или восстановить пароль root на OPNsense
  • Как сбросить или изменить пароль Windows 8 или 7 с NTPasswd?
  • ⌛ Как восстановить забытый или утерянный пароль root в Fedora
  • 3 простых способа восстановить забытый пароль Windows

The Error “Plugin ‘unix_socket’ is not loaded” is commonly seen on Ubuntu 15.04/15.10/16.04 and any derivative distributions such as Linux Mint 18. This tutorial shows how to fix it.

What is the Unix_Socket Plugin?

The Unix_Socket authentication plugin, which allows users to use OS credentials to connect to MariaDB via Unix socket, is first supported in MariaDB 5.2.0. This plugin is not installed by default.

Log into MariaDB monitor.

mysql -u root -p

Then install the Unix_Socket plugin with this command:

MariaDB [(none)]>  install plugin unix_socket soname 'auth_socket';

My Ubuntu system has a user named linuxbabe, so I create a MariaDB user linuxbabe identified via the unix_socket plugin.

MariaDB [(none)]> create user linuxbabe identified via unix_socket;

Exit out of MariaDB monitor.

MariaDB [(none)]> quit

And now I can log into MariaDB monitor as user linuxbabe without typing password because I already logged into Ubuntu system as linuxbabe.

mariadb unix_socket plugin

That’s how Unix_Socket authentication plugin works.

Fix Plugin ‘unix_socket’ is not loaded Error

The Unix_Socket authentication plugin only works when your Linux OS and MariaDB have a user account with the same username.

Your Linux OS has a root user. MariaDB also has a root user. So sometimes, when you try to log into MariaDB monitor as root user, MariaDB may authenticate you via the Unix_Socket plugin but this plugin is not installed by default. So you see Plugin 'unix_socket' is not loaded Error.

Another authentication plugin is mysql_native_password. MariaDB uses this plugin to authenticate a user who is created with this command:

create user [email protected] identified by password 'secret_password';

To fix the above error, we can tell MariaDB to use mysql_native_password plugin to authenticate root user.

First stop MariaDB. If you have installed MariaDB from Ubuntu repository, use this command to stop it.

sudo systemctl stop mysql

If you have installed MariaDB from MariaDB repository, use the following command to stop it.

sudo systemctl stop mariadb

Then start MariaDB with --skip-grant-tables option which bypass user authentication.

sudo mysqld_safe --skip-grant-tables &

Next, log into MariaDB monitor as root.

mysql -u root

Enter the following SQL statement to check which authentication plugin is used for root.

MariaDB [(none)]> select Host,User,plugin from mysql.user where User='root';

Plugin 'unix_socket' is not loaded

You might see it’s using unix_socket plugin. To change it to mysql_native_password plugin, execute this command:

MariaDB [(none)]> update mysql.user set plugin='mysql_native_password';

If you forgot the MariaDB root user password, you can also change the root password now with the following command:

MariaDB [(none)]> update mysql.user set password=PASSWORD("newpassword") where User='root';

Exit MariaDB monitor.

flush privileges;
quit;

Stop mysqld_safe

sudo kill -9 $(pgrep mysql)

Start MariaDB again.

sudo systemctl start mysql     or   sudo systemctl start mariadb

Now you can use normal password to login.

mysql -u root -p

I hope this article helped you to fix Plugin ‘unix_socket’ is not loaded error. Comments, questions or suggestions are always welcome. If you found this post useful, ? please share it with your friends on social media! Stay tuned for more tutorials.

Понравилась статья? Поделить с друзьями:
  • Mysql error 1410 42000 you are not allowed to create a user with grant
  • Mysql error 1396 hy000 operation alter user failed
  • Mysql error 1317
  • Mysql error 1130 localhost is not allowed to connect to this mysql server
  • Mysql error 1130 hy000 host is not allowed to connect to this mysql server