Using % or localhost for host when creating MySQL user

Posted on

‘localhost’ is special in mysql, it means a connection over a unix socket (or named pipes on windows I believe) as opposed to a TCP/IP socket, using % as the host does not include ‘localhost’

If you want connect to user@’%’ from localhost use mysql -h192.168.0.1 -uuser -p

Leave a comment