博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PHP里用户密码的回复和管理
阅读量:7009 次
发布时间:2019-06-28

本文共 3577 字,大约阅读时间需要 11 分钟。

1). In /etc/my.ini, add

skip-grant-tables

 

2). mysql -u root -p            (no password required)

mysql> show databases;

+--------------------+
| Database           |
+--------------------+
| information_schema |
| cacti              |
| gfxpv_database     |
| mysql              |
| test               |
+--------------------+
5 rows in set (0.08 sec)

3). select cacti database

mysql> use cacti;

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

4).  show all tables in cacti database

 

mysql> show tables;

+---------------------------+
| Tables_in_cacti           |
+---------------------------+
| cdef                      |
| cdef_items                |
| colors                    |
| data_input                |
| data_input_data           |
| data_input_fields         |
| data_local                |
| data_template             |
| data_template_data        |
| data_template_data_rra    |
| data_template_rrd         |
| graph_local               |
| graph_template_input      |
| graph_template_input_defs |
| graph_templates           |
| graph_templates_gprint    |
| graph_templates_graph     |
| graph_templates_item      |
| graph_tree                |
| graph_tree_items          |
| host                      |
| host_graph                |
| host_snmp_cache           |
| host_snmp_query           |
| host_template             |
| host_template_graph       |
| host_template_snmp_query  |
| plugin_config             |
| plugin_db_changes         |
| plugin_hooks              |
| plugin_realms             |
| poller                    |
| poller_command            |
| poller_item               |
| poller_output             |
| poller_reindex            |
| poller_time               |
| rra                       |
| rra_cf                    |
| settings                  |
| settings_graphs           |
| settings_tree             |
| snmp_query                |
| snmp_query_graph          |
| snmp_query_graph_rrd      |
| snmp_query_graph_rrd_sv   |
| snmp_query_graph_sv       |
| user_auth                 |
| user_auth_perms           |
| user_auth_realm           |
| user_log                  |
| version                   |
+---------------------------+
52 rows in set (0.00 sec)

 

5). select all user in the user_auth table(cacti database)

mysql> select * from user_auth;

+----+----------+----------------------------------+-------+---------------+----------------------+-----------+-----------+--------------+----------------+------------+---------------+--------------+--------------+------------------------+---------+
| id | username | password                         | realm | full_name     | must_change_password | show_tree | show_list | show_preview | graph_settings | login_opts | policy_graphs | policy_trees | policy_hosts | policy_graph_templates | enabled |
+----+----------+----------------------------------+-------+---------------+----------------------+-----------+-----------+--------------+----------------+------------+---------------+--------------+--------------+------------------------+---------+
|  1 | admin    | e10adc3949ba59abbe56e057f20f883e |     0 | Administrator |                      | on        | on        | on           | on             |          1 |             1 |            1 |            1 |                      1 | on      |
|  3 | guest    | 43e9a4ab75570f5b                 |     0 | Guest Account | on                   | on        | on        | on           | on             |          3 |             1 |            1 |            1 |                      1 |         |
+----+----------+----------------------------------+-------+---------------+----------------------+-----------+-----------+--------------+----------------+------------+---------------+--------------+--------------+------------------------+---------+
2 rows in set (0.00 sec)

 

6). update "guest" account with password "guest"

mysql> update user_auth set password=PASSWORD('guest') where username='guest';

Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> update user_auth set password=PASSWORD('admin') where username='admin';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

 

still not working!!!!!!!!!!!!!!!!!

转载于:https://www.cnblogs.com/kylegui/p/3840931.html

你可能感兴趣的文章
前端学习之路,我的奋斗与我的困境。个人情况,希望能得到建议及指导
查看>>
实现在线预览远程服务器pdf文件心路历程
查看>>
【BZOJ】2004: [Hnoi2010]Bus 公交线路 状压DP+矩阵快速幂
查看>>
网易七鱼(杭州)招聘前端
查看>>
[BZOJ 2716][Violet 3]天使玩偶(CDQ分治+树状数组)
查看>>
javaSE基础知识 1.4常量
查看>>
转载C#泛型集合—Dictionary<K,V>使用技巧
查看>>
js总结
查看>>
如何做到在webpack打包vue项目后,在外部动态修改配置文件
查看>>
Vim
查看>>
Android实践项目汇报(三)
查看>>
css3 transition的各种ease效果
查看>>
c语言学习之基础知识点介绍(十二):结构体的介绍
查看>>
oc语言学习之基础知识点介绍(三):类方法、封装以及继承的介绍
查看>>
Alpha项目测试
查看>>
LOJ#3048. 「十二省联考 2019」异或粽子(trie树+堆)
查看>>
BZOJ3864 & HDU4899:Hero meet devil——题解
查看>>
spring data jpa 的使用
查看>>
elk安装与搭建
查看>>
北京 白宫 克里姆尼宫 爱丽舍宫 青瓦台
查看>>