Я только что установил MySQL в Mac OS X. Следующим шагом была установка пароля пользователя root, поэтому я сделал следующее:
В командной строке Unix я выполнил следующие команды:
$ cd / usr / local / mysql / bin
$ ./mysqladmin -u пароль root 'пароль'
Но когда я выполняю команду
$ ./mysql -u root
, я получаю ответ:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 224
Server version: 5.5.13 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Я могу войти в командную строку mysql
без пароля!
Почему это?
К ссылочному MySQL 8.0.15 +, пароль () функция не доступна. Используйте команду ниже.
Доброжелательное использование
UPDATE mysql.user SET authentication_string='password' WHERE User='root';