HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

restrict user host settings to socket connection only

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
settingsuserhostrestrictsocketonlyconnection

Problem

Is there a way to restrict a user's host setting so that (s)he can only connect by socket and not TCP/IP? I'd like to have this setting for the root account.

edit: As Abdul Manaf pointed out skip-networking can be used to turn off TCP/IP connectivity altogether. But can it be done on a user account basis?

Solution

If you only want to listen MySQL connections only using socket add a line in my.cnf and restart MySQL server.

skip-networking


This is recommended practice when there is no reason for it to listen on TCP.

Code Snippets

skip-networking

Context

StackExchange Database Administrators Q#45409, answer score: 2

Revisions (0)

No revisions yet.