Mysql5server is installed in Ubuntu. The result is unknown. The root account and password entered during installation cannot be verified by the database server in any way. Instead, you only need to reset the password of the mysql root Account. Check that the root account password is successfully reset using the following methods. First stop mysql service: root @ webserver:/home/webmaster # servicemysqlstop and then ignore Password Authentication Mode
Mysql 5 server is installed in Ubuntu. The result is unknown. The root account and password entered during installation cannot be verified by the database server in any way. Instead, you only need to reset the password of the mysql root Account. Check that the root account password is successfully reset using the following methods.
First stop the mysql service:
Root @ webserver:/home/webmaster # service mysql stop
Then, a new mysql service is created in the ignore Password Authentication Mode:
Root @ webserver:/home/webmaster # mysqld -- user = mysql -- skip-grant-tables -- skip-networking &
After successful startup, the PID and other startup information are returned:
[1] 3591
Root @ webserver:/home/webmaster #121005 2:59:27 [Note] Plugin 'federated 'is disabled.
121005 2:59:27 InnoDB: The InnoDB memory heap is disabled
121005 2:59:27 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121005 2:59:27 InnoDB: Compressed tables use zlib 1.2.3.4
121005 2:59:27 InnoDB: Initializing buffer pool, size = 128.0 M
121005 2:59:27 InnoDB: Completed initialization of buffer pool
121005 2:59:27 InnoDB: highest supported file format is Barracuda.
121005 2:59:27 InnoDB: Waiting for the background threads to start
121005 2:59:28 InnoDB: 1.1.8 started; log sequence number 1595685
121005 2:59:28 [Note] mysqld: ready for connections.
Version: '5. 5.24-0ubuntu0. 12.04.1 'socket: '/var/run/mysqld. sock' port: 0 (Ubuntu)
Connect to the mysql database:
Root @ webserver:/home/webmaster # mysql-u root mysql
After connecting to the mysql database, directly change the root account password to the new password 'mynewpasswd ':
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql> update user set Password = PASSWORD ('mynewpasswd') where user = 'root ';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
Mysql> flush privileges;
Mysql> quit;
Bye
Stop the mysql service process (for PID 3591, see the screen information before starting the Service ):
Root @ webserver:/home/webmaster # kill 3591
Start the mysql service normally and log on to the mysql server with the new password:
Root @ webserver:/home/webmaster # service mysql start
Root @ webserver:/home/webmaster # mysql-u root-pmynewpasswd