MySQL 5.7 新增默认账号 mysql.session和mysql.sys

MySQL 5.7 新增默认账号 mysql.session和mysql.sys,第1张

在闲逛mysql时发现mysql库的user表下有两个账户比较特别:mysql.session 和 mysql.sys查一下 user 表里面都有哪些账户:mysql.sys@localhost:用于 sys schema 中对象的定义。使用 mysql.sys 用户可避免 DBA 重命名或者删除 root 用户时发生的问题。该用户已被锁定,客户端无法连接。mysql.session@localhost:插件内部使用来访问服务器。该用户已被锁定,客户端无法连接。 root@localhost:这个就是 root 账号啦!其用于管理。该用户拥有所有权限,可执行任何 *** 作。严格来说,这个账号不应该被保留。 root 是 MySQ L的特权账号,这个众所周知,也带来安全隐患。建议将root账号禁用或者删除,新建一个特权账号用于管理。 在MySQL 5.6以前,我们通过 show processlist\G 命令查看系统中正在运行的所有进程: 从5.7开始,我们又可以通过 sys.session 表来查看系统正在运行的所有进程,而且该表中的记录相 processlist 比较完善: 很显然, select * from sys.session 能得到更多的信息。

MySQL 5.7 新增默认账号 mysql.session和mysql.syshttps://www.jianshu.com/p/427cac0d8763Privileges Supported by MySQLhttps://dev.mysql.com/doc/refman/5.7/en/grant.htmlMySQL 5.7 Reference Manual/Reserved Accountshttps://dev.mysql.com/doc/refman/5.7/en/reserved-users.htmlWhat are mysql.session@localhost and mysql.sys@localhost user accounts good for?https://stackoverflow.com/questions/46149220/what-are-mysql-sessionlocalhost-and-mysql-syslocalhost-user-accounts-good-forOne part of the MySQL installation process is data directory initialization (see  Section 2.10.1, “Initializing the Data Directory” ).  During data directory initialization, MySQL creates user accounts that should be considered reserved:'root'@'localhost : Used for administrative purposes. This account has all privileges and can perform any operation. Strictly speaking, this account name is not reserved, in the sense that some installations rename the root account to something else to avoid exposing a highly privileged account with a well-known name.'mysql.sys'@'localhost' : Used as the DEFINER for  sys  schema objects. Use of the mysql.sys account avoids problems that occur if a DBA renames or removes the root account. This account is locked so that it cannot be used for client connections.'mysql.session'@'localhost' : Used internally by plugins to access the server. This account is locked so that it cannot be used for client connections.用于sys schema中对象的定义。使用mysql.sys用户可避免DBA重命名或者删除root用户时发生的问题。该用户已被锁定,客户端无法连接。插件内部使用来访问服务器。该用户已被锁定,客户端无法连接。root账号,其用于管理。该用户拥有所有权限,可执行任何 *** 作。 root是MySQL的特权账号,这个众所周知,也带来安全隐患,建议将root账号禁用或者删除,新建一个特权账号用于管理。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/6197356.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-17
下一篇 2023-03-17

发表评论

登录后才能评论

评论列表(0条)

保存