2013-10-23 16 views

risposta

26

Dopo il collegamento a MySQL eseguire

use mysql; 
update user set user='admin' where user='root'; 
flush privileges; 

Questo è tutto.

Se anche voi volete cambiare la password, in MySQL < 5.7, eseguire

update user set password=PASSWORD('new password') where user='admin'; 

prima flush privileges;. In MySQL> = 5.7, il campo password nella tabella user è stato rinominato authentication_string, in modo che la linea di cui sopra diventa:

update user set authentication_string=PASSWORD('new password') where user='admin'; 
1

Volevo solo dire che per me, non c'era colonna 'password'.

Per modificare la password, il campo è stato corretto authentication_string

Così il comando è

update user set authentication_string=PASSWORD('new password') where user='admin'; 

Non sono un esperto di MySQL, quindi non so esattamente perché, ma quello che ho detto è corretto , almeno nel mio caso.

+1

Questo accade solo dopo MySQL 5.7, non è stato il caso quando ho postato la mia risposta. Ho aggiornato la mia risposta. –

Problemi correlati