MySQL 权限管理的注意事项

php中文网
发布: 2016-06-07 17:29:14
原创
929人浏览过

㈠ 认证和授权 认证:who am I ? 授权:what I can do ? 认证实际上就是一个验证凭证的过程、而进入MySQL 需要出示的凭证有:

 ㈠ 认证和授权

认证:who am I ?

授权:what I can do ?

认证实际上就是一个验证凭证的过程、而进入MySQL 需要出示的凭证有:host、username、password

连接MySQL 常见有 2 种:

① TCP/IP 连接

加 -h 参数、通过TCP/IP 连接MySQL 实例、mysql.user 对来者进行认证

② Socket

-S 参数 、只能在 MySQL 客户端和实例在同一台服务器上使用

㈡ 缺省有 2 个高危险用户:

新智能企业网站管理系统2.1
新智能企业网站管理系统2.1

系统管理:密码管理、系统配置、数据库备份、后台日志管理 管理员管理模块:管理员的添删改查以及管理员的权限设置 会员管理系统:注册会员的管理 IP锁定管理:IP地址的锁定 企业信息模块:公司简介、公司文化等栏目的随意设置 新闻系统模块:公司新闻、文章发布 产品系统模块:包括产品类别管理 友情连接模块:友情连接管理 招聘系统模块:招聘发布以及应聘管理 在线留言系统:客户留言信息的管理

新智能企业网站管理系统2.1 0
查看详情 新智能企业网站管理系统2.1

㈢ % 不是万能的、至少无法替代 localhost、而 MySQL 默认却是以 localhost登陆

mysql> grant all on *.* to 'david'@'%' identified by 'Oracle';
Query OK, 0 rows affected (0.05 sec)


[mysql@odd ~]$ mysql -udavid -poracle
ERROR 1045 (28000): Access denied for user 'david'@'localhost' (using password: YES)
[mysql@odd ~]$ mysql -udavid -poracle -h 127.0.0.1
ERROR 1045 (28000): Access denied for user 'david'@'localhost' (using password: YES)


mysql> grant all on *.* to 'david'@'localhost' identified by 'oracle';
Query OK, 0 rows affected (0.01 sec)


[mysql@odd ~]$ mysql -udavid -poracle
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.5.16-log Source distribution

Copyright (c) 2000, 2011, 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.

linux

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号