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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. How to recover deleted Logical volume (LV) in LVM using vgcfgrestore
  2. 10 useful cron examples to schedule jobs in Linux
  3. Audit rules for monitoring Copy, move, delete and kill Commands In Linux
  4. How to set “max_report_luns” and “max_luns” on CentOS/RHEL 6 to scan more than 512 LUNs
  5. pvcreate Fails With Error: “Device /dev/mapper/mpatha Not Found (or Ignored By Filtering).”
  6. How to Install MySQL Cluster on a single server for testing purposes
  7. When to use rescan-scsi-bus.sh -i (LIP flag) in CentOS/RHEL
  8. Permission Table for a File/Directory And File System Users Types
  9. How to resize (extend) a partition-based file system in Linux
  10. How to Disable “Predictable Network Interface Device Names” in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • How to set the default character set in MySQL and how to propagate it in a master-master replication scenario
  • “Connection reset by peer” – error while ssh into a CentOS/RHEL system with a specific user only
  • MySQL: how to figure out which session holds which table level or global read locks
  • Recommended Configuration of the MySQL Performance Schema
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary