Форум русскоязычного сообщества Ubuntu


Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?
Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!

Автор Тема: Пароль в mysql  (Прочитано 2803 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн mstdmstd

  • Автор темы
  • Активист
  • *
  • Сообщений: 322
    • Просмотр профиля
Пароль в mysql
« : 17 Июня 2018, 10:45:17 »
Всем привет,
Установил локально kubuntu18.04  и при установке что-то не получилось с паролем для mysql
В открывающемся диалоге при установке mysql я дважды ввел 1  но в phpmyadmin войти не могу

Я пытался изменить в консоле но безуспешно:
Server version: 5.7.22-0ubuntu18.04.1 (Ubuntu)

Copyright (c) 2000, 2018, 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> update user set password=PASSWORD("1") where User='root';
ERROR 1046 (3D000): No database selected
mysql> 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
mysql> update user set password=PASSWORD("1") where User='root';
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('1');
Query OK, 0 rows affected, 2 warnings (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

И напомните а команду mysql_secure_installation вводить нужно было ?
Я не вводил ...

Как проверить текущий пароль и его сменить?

Спасибо !


Пользователь добавил сообщение 17 Июня 2018, 15:41:05:

Я зашел в mysql-консоль в mysql-базу и открыв таблицу user :
https://imgur.com/a/NxRe0qo

дейстыительноо не вижу поле password
и непонятно почему второй запрос выдал варнинг что ничего не нашел ? разве формат неправилен?
« Последнее редактирование: 17 Июня 2018, 15:41:05 от mstdmstd »

Оффлайн mstdmstd

  • Автор темы
  • Активист
  • *
  • Сообщений: 322
    • Просмотр профиля
Re: Пароль в mysql
« Ответ #1 : 21 Июня 2018, 08:04:11 »
нашел статью
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-18-04

И выполняя команды по ней:
# sudo mysql_secure_installation
 
Securing the MySQL server deployment.
                                                                                                                                                                                                                                             
Connecting to MySQL using a blank password.                                                                                                                                                                                                   
The 'validate_password' plugin is installed on the server.                                                                                                                                                                                   
The subsequent steps will run with the existing configuration                                                                                                                                                                                 
of the plugin.                                                                                                                                                                                                                               
Please set the password for root here.                                                                                                                                                                                                       
                                                                                                                                                                                                                                             
New password:                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                             
Re-enter new password:                                                                                                                                                                                                                       
                                                                                                                                                                                                                                             
Estimated strength of the password: 0                                                                                                                                                                                                         
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Y                                                                                                                                             
By default, a MySQL installation has an anonymous user,                                                                                                                                                                                       
allowing anyone to log into MySQL without having to have                                                                                                                                                                                     
a user account created for them. This is intended only for                                                                                                                                                                                   
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
 
Remove anonymous users? (Press y|Y for Yes, any other key for No) : k
 
 ... skipping.
 
 
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
 
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n
 
 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
 
 
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : n
 
 ... skipping.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
 
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
 
All done!



Столкнулся с ошикой при установке пароля вручную:
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
+------------------+-------------------------------------------+-----------------------+-----------+
| user             | authentication_string                     | plugin                | host      |
+------------------+-------------------------------------------+-----------------------+-----------+
| root             |                                           | auth_socket           | localhost |
| mysql.session    | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost |
| mysql.sys        | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password | localhost |
| debian-sys-maint | *57A7D3C520B6878F27738F51372311884DBF2566 | mysql_native_password | localhost |
| phpmyadmin       | *E6CC90B878B948C35E92B003C792C46C58C4AF40 | mysql_native_password | localhost |
+------------------+-------------------------------------------+-----------------------+-----------+
5 rows in set (0.01 sec)

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '1';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '97531';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'a9b7b5b3b1';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'a9&b7b&5b3b1';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
Непонятно какие пароли должны “satisfy the current policy requirements”  и можно ли поменять эти правила - это персональный
ноут - тут не нужен сложный пароль...

Оффлайн mstdmstd

  • Автор темы
  • Активист
  • *
  • Сообщений: 322
    • Просмотр профиля
Re: Пароль в mysql
« Ответ #2 : 22 Июня 2018, 13:57:54 »
Сорри, это только у меня одного такие проблемы с устновкой mysql пароля в kubuntu18.04 ?
Ранее таких проблем не было...

Оффлайн kalek

  • Активист
  • *
  • Сообщений: 267
    • Просмотр профиля
Re: Пароль в mysql
« Ответ #3 : 22 Июня 2018, 14:54:43 »
какие пароли должны “satisfy the current policy requirements”
можно посмотреть примерно так
SHOW VARIABLES LIKE 'validate_password%';должно выдать несколько переменных, задающих эти самые "current policy requirements".
Соответственно и поменять их можно так же как и другие переменные

 

Страница сгенерирована за 0.047 секунд. Запросов: 22.