• 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. Repairing filesystem issues at Boot in CentOS/RHEL 7 and 8
  2. Linux / UNIX : How to send mails with attachments using mailx command
  3. How to Add Data Nodes to MySQL Cluster without Restarting the Cluster (version 6.4 and later)
  4. How to Check if any of the RPM files were tampered with
  5. How to Install GUI On CentOS/RHEL 8
  6. nmcli device Command Examples in Linux
  7. CentOS / RHEL 7 : How to install and configure ftp server (vsftpd)
  8. MySQL – How to undo (rollback) a set of SQL statements
  9. xclip: command not found
  10. bat Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qsub Command Examples in Linux
  • qsub: command not found
  • qrcp Command Examples in Linux
  • qmrestore Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright