av手机免费在线观看,国产女人在线视频,国产xxxx免费,捆绑调教一二三区,97影院最新理论片,色之久久综合,国产精品日韩欧美一区二区三区

php語言

PHP數(shù)據(jù)庫:mysql重置密碼

時(shí)間:2025-04-12 16:03:03 php語言 我要投稿
  • 相關(guān)推薦

PHP數(shù)據(jù)庫:mysql重置密碼

  認(rèn)真掌握好每一個(gè)知識(shí)點(diǎn),對(duì)容易混淆的知識(shí)點(diǎn)更是要下大工夫搞清楚。以下是百分網(wǎng)小編精心為大家整理的PHP語言編寫知識(shí)點(diǎn)之mysql重置密碼,希望對(duì)大家有所幫助!更多內(nèi)容請(qǐng)關(guān)注應(yīng)屆畢業(yè)生網(wǎng)!

  mysql重置密碼

  wulilideMacBook-Pro:bin wulili$ mysql start

  ERROR 1045 (28000): Access denied for user 'wulili'@'localhost' (using password: NO)

  wulilideMacBook-Pro:bin wulili$ su - root

  1、把mysql服務(wù)關(guān)閉

  2、啟動(dòng)mysqld_safe ,跳過啟動(dòng)授權(quán)表。啟動(dòng)時(shí)加上skip-grant-tables參數(shù)目的是在啟動(dòng)mysql時(shí)不啟動(dòng)grant-tables,授權(quán)表。這樣就可以修改root的密碼了。

  # mysqld_safe --skip-grant-tables &

  wulilideMacBook-Pro:support-files root# find / -name mysqld_safe

  find: /dev/fd/3: Not a directory

  find: /dev/fd/4: Not a directory

  /usr/local/mysql-5.7.16-osx10.11-x86_64/bin/mysqld_safe

  wulilideMacBook-Pro:support-files root# /usr/local/mysql-5.7.16-osx10.11-x86_64/bin/mysqld_safe --skip-grant-tables &

  [1] 1397

  wulilideMacBook-Pro:support-files root# 2016-11-30T11:47:40.6NZ mysqld_safe Logging to '/usr/local/mysql/data/wulilideMacBook-Pro.local.err'.

  2016-11-30T11:47:40.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

  mysql -uroot -p

  Enter password: 按下回車鍵

  Welcome to the MySQL monitor. Commands end with ; or \g.

  Your MySQL connection id is 2

  Server version: 5.7.16 MySQL Community Server (GPL)

  Copyright (c) 2000, 2016, 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> update user set password=PASSWORD('12345678') where user="root";

  ERROR 1046 (3D000): No database selected

  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('12345678') where user="root";

  ERROR 1054 (42S22): Unknown column 'password' in 'field list'

  mysql> update user set passwd=PASSWORD('12345678') where user="root";

  ERROR 1054 (42S22): Unknown column 'passwd' in 'field list'

  mysql> update user set password=password('12345678') where User='root';

  ERROR 1054 (42S22): Unknown column 'password' in 'field list'

  mysql> update user set authentication_string=password('12345678') where user="root";

  Query OK, 1 row affected, 1 warning (0.01 sec)

  Rows matched: 1 Changed: 1 Warnings: 1

  mysql> flush privileges;

  Query OK, 0 rows affected (0.00 sec)

  mysql> quit

  Bye

  3、重啟數(shù)據(jù)庫

  wulilideMacBook-Pro:support-files root# /usr/local/mysql/support-files/mysql.server restart

  Shutting down MySQL

  ..2016-11-30T11:58:22.6NZ mysqld_safe mysqld from pid file /usr/local/mysql/data/wulilideMacBook-Pro.local.pid ended

  SUCCESS!

  Starting MySQL

  . SUCCESS!

  [1]+ Done /usr/local/mysql-5.7.16-osx10.11-x86_64/bin/mysqld_safe --skip-grant-tables

  wulilideMacBook-Pro:support-files root# mysql -u root -p 這里密碼就是12345678了

  Enter password:

  Welcome to the MySQL monitor. Commands end with ; or \g.

  Your MySQL connection id is 4

  Server version: 5.7.16

  Copyright (c) 2000, 2016, 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> quit

  Bye

  wulilideMacBook-Pro:support-files root#

  mysql> use mysql;

  ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

  mysql> alter user 'root'@'localhost' identified by '12345678';

  Query OK, 0 rows affected (0.01 sec)

  mysql> flush privileges;

  Query OK, 0 rows affected (0.00 sec)

  mysql> show databases;

  +--------------------+

  | Database |

  +--------------------+

  | information_schema |

  | mysql |

  | performance_schema |

  | sys |

  +--------------------+

  4 rows in set (0.00 sec)

【PHP數(shù)據(jù)庫:mysql重置密碼】相關(guān)文章:

php連接mysql數(shù)據(jù)庫代碼08-01

PHP操作MySQL數(shù)據(jù)庫的基本類03-22

PHP腳本測試連接MySQL數(shù)據(jù)庫05-19

php入門之連接mysql數(shù)據(jù)庫05-04

PHP對(duì)數(shù)據(jù)庫MySQL的連接操作05-19

如何在PHP中連接MySQL數(shù)據(jù)庫04-13

php向Mysql數(shù)據(jù)庫保存數(shù)據(jù)的代碼04-24

PHP向MySQL數(shù)據(jù)庫保存數(shù)據(jù)代碼03-21

PHP 中 MySQL 數(shù)據(jù)庫異步查詢實(shí)現(xiàn)03-03