MySQL меняем пароль root
На днях поставил mysql, но забыл пароль root.
Сменил следующим образом: [-hide-] # /usr/local/etc/rc.d/mysql-server stop Stopping mysql. Waiting for PIDS: 73146. monitor# mysqld_safe –skip-grant-tables & [1] 24137 monitor# 110702 09:48:20 mysqld_safe Logging to ‘/var/db/mysql/monitor.local.uzh.err’. 110702 09:48:20 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.13 Source distribution Copyright (c) 2000, 2010, 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> 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(‘root_mysql’) where user=’root’ and host=’localhost’; Query OK, 1 row affected (0.23 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.05 sec) mysql> quit Bye Маленькая такая заметка.[-hide-] |