• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

What is the purpose of “mysql.sys@localhost” user

by admin

This post explains why the mysql.sys@localhost user exists and what it is used for.

The mysql.sys@localhost user is a system user used as the definer for view, procedures, and functions in the sys schema. It was added in MySQL 5.7.9 to avoid issues if the DBA renames the root@localhost user. See also MySQL sys Schema in the Reference Manual.

The following applies to the mysql.sys@localhost user:

1. It is a required user as long as the sys schema is installed. Please do not drop the user.

2. It is locked by default, so it cannot be used to access MySQL:

mysql> SHOW CREATE USER 'mysql.sys'@localhost\G
*************************** 1. row ***************************
CREATE USER for mysql.sys@localhost: CREATE USER 'mysql.sys'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT LOCK
1 row in set (0.00 sec)

Notice the ACCOUNT LOCK.

3. It uses an invalid password (see the output of SHOW CREATE USER above). This ensures that should the account get unlocked by mistake, it is still impossible to login. It is thus recommended not to reset the password.

What are Reserved User Accounts in MySQL

Filed Under: Linux, mysql

Some more articles you might also be interested in …

  1. LVM error “WARNING: Inconsistent metadata found” – How to resolve in CentOS / RHEL
  2. How to List Users and Privileges in MySQL
  3. lvchange Command Examples in Linux
  4. How to disable NUMA on EFI Boot Loaders using GRUB2 (CentOS/RHEL 6)
  5. Audit rules for monitoring Copy, move, delete and kill Commands In Linux
  6. How to change the NIC device name in CentOS / RHEL 6
  7. kill Command Examples in Linux
  8. LVM Configuration : Physical Volume (PV) Operations/Utilities
  9. SSSD Service Failing with “SSSD is already running” in CentOS/RHEL 7
  10. How to Change the Default Timeout Settings for Telnet Session in CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright