• 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

How to Disable Client Access Control in MySQL

by admin

You can disable the client access control in MySQL by telling the server not to read the grant tables and disable access control. Use the –skip-grant-tables option to do so. The –skip-grant-tables option has the following effects:

  • When connected, the user has full privileges to do anything.
  • This option disables account management statements such as CREATE USER, GRANT, REVOKE, and SET PASSWORD.

Disabling access control is convenient if you forget the root password and need to reset it because any user can connect with full privileges without providing a password. This is clearly dangerous. To prevent remote clients from connecting over TCP/IP, use the –skip- networking option. Clients then can connect only from the localhost using a socket file on UNIX, or a named pipe or shared memory on Windows. To avoid casual connections from the localhost, use a non-standard socket name at the command prompt.

Account management statements require the in-memory copies of the grant tables, which are not available when you disable access control. To change privileges or set a password, modify the grant tables directly. Alternatively, issue a FLUSH PRIVILEGES statement after connecting to the server, which causes the server to read the tables and also enables the account management statements.

Conclusion

When you disable the client access control in MySQL,

1. Every connection succeeds:

  • You can provide any username and any password, and you can connect from any host.
  • The option disables the privilege system entirely.
  • Connected users effectively have all privileges.

2. Prevent clients from connecting:

  • Use the –skip-networking option to prevent network access and allow access only on local socket, named pipe, or shared memory.
  • Use the –socket option to start the server on a non- standard socket to prevent casual access by local applications or users.

Filed Under: Linux, mysql

Some more articles you might also be interested in …

  1. chpasswd Command Examples in Linux
  2. esearch Command Examples in Linux
  3. LVM Configuration : Logical Volume (LV) Operations/Utilities
  4. RHEL / CentOS : How to rebuild LVM from Archive (metadata backups)
  5. “mdadm: No arrays found in config file” – error on running ‘mdadm –assemble –scan’
  6. Configuring Remote Logging using rsyslog in CentOS/RHEL
  7. How to Force ASM to Scan the Multipathed Device First using ASMLIB/oracleasm
  8. CentOS / RHEL 5 : How to rebuild Initial Ramdisk Image
  9. beep Command Examples in Linux
  10. lnstat Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright