Código (bash) [Seleccionar]
shellroot@alex-laptop:~$ mysql -u root -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 38
Server version: 5.1.41-3ubuntu12.3 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>set password for root@localhost=password('nuevacontraseña');
Query OK, 0 rows affected (0.00 sec)
mysql>