mySQL: não é possível definir a senha para debian-sys-maint

0

Se eu pudesse definir a senha para o debian-sys-maint, eu poderia instalar o pacote phpmyadmin, e seria ótimo! Mas com o mySQL 5.7 e algumas configurações locais aleatórias, não é tão fácil definir senhas, porque não é óbvio com qual módulo de autenticação devo falar. Eu tentei:

 mysql> alter user 'debian-sys-maint'@'localhost' identified with mysql_native_password as 'MyNewPass';
 ERROR 1396 (HY000): Operation ALTER USER failed for 'debian-sys-maint'@'localhost'
 mysql> alter user 'debian-sys-maint'@'localhost' identified with mysql_native_password as 'MyNewPass';
 ERROR 1396 (HY000): Operation ALTER USER failed for 'debian-sys-maint'@'localhost'
 mysql> flush privileges;
 Query OK, 0 rows affected (0.01 sec)



 mysql> show plugins
     -> ;
 +----------------------------+----------+--------------------+---------+---------+
 | Name                       | Status   | Type               | Library | License |
 +----------------------------+----------+--------------------+---------+---------+
 | binlog                     | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
 | mysql_native_password      | ACTIVE   | AUTHENTICATION     | NULL    | GPL     |
 | sha256_password            | ACTIVE   | AUTHENTICATION     | NULL    | GPL     |
   ...
 | MEMORY                     | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
 | InnoDB                     | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
 +----------------------------+----------+--------------------+---------+---------+
 44 rows in set (0.00 sec)


 $ apt-show-versions | grep -i mysql
 dbconfig-mysql:all/xenial 2.0.4ubuntu1 uptodate
 libmysqlclient-dev:amd64/xenial-security 5.7.17-0ubuntu0.16.04.1 upgradeable to 5.7.18-0ubuntu0.16.04.1
 libmysqlclient-dev:i386 not installed
 libmysqlclient20:amd64/xenial-security 5.7.17-0ubuntu0.16.04.1 upgradeable to 5.7.18-0ubuntu0.16.04.1
 libmysqlclient20:i386 not installed
 mysql-client:all/xenial-security 5.7.17-0ubuntu0.16.04.1 upgradeable to 5.7.18-0ubuntu0.16.04.1
 mysql-client-5.7:amd64/xenial-security 5.7.18-0ubuntu0.16.04.1 uptodate
 mysql-client-5.7:i386 not installed
 mysql-client-core-5.7:amd64/xenial-security 5.7.18-0ubuntu0.16.04.1 uptodate
 mysql-client-core-5.7:i386 not installed
 mysql-common:all/xenial-security 5.7.18-0ubuntu0.16.04.1 uptodate
 mysql-server:all/xenial-security 5.7.18-0ubuntu0.16.04.1 uptodate
 mysql-server-5.7:amd64/xenial-security 5.7.18-0ubuntu0.16.04.1 uptodate
 mysql-server-5.7:i386 not installed
 mysql-server-core-5.7:amd64/xenial-security 5.7.18-0ubuntu0.16.04.1 uptodate
 mysql-server-core-5.7:i386 not installed
 php-mysql:all/xenial 1:7.0+35ubuntu6 uptodate
 php7.0-mysql:amd64/xenial-security 7.0.15-0ubuntu0.16.04.4 uptodate
 php7.0-mysql:i386 not installed

Como posso definir a senha?

    
por Dave Morse 02.05.2017 / 23:14

1 resposta

0

Isso parece ter funcionado:

UPDATE mysql.user SET authentication_string=PASSWORD('MyNewPass') WHERE  User='debian-sys-maint' AND Host='localhost';
flush privileges;
    
por Dave Morse 03.05.2017 / 17:51