Mysql enabling remote and local access

前端 未结 1 1768
长发绾君心
长发绾君心 2020-12-22 07:37

I just enabled remote access on my mysql server. I did this by going to the database \'mysql\' , then the user table and changing the Host column to \'%\' of the appropriat

1条回答
  •  有刺的猬
    2020-12-22 08:06

    You need to have a separate row in the mysql.user table with a host value of 'localhost', to enable local unix socket type connections.

    A value of '%' in the host column is for the TCP protocol.

    Details in the documentation here: http://dev.mysql.com/doc/refman/5.5/en/connecting.html

    I have three rows for a user in the mysql.user table, with host values of 'localhost' (for unix socket type connections), '127.0.0.1' for access via TCP from the local host, and '%' for TCP access from other hosts.

    Note that MySQL identifies a user not just by the "username", but as the combination of "username" and "host". These are considered distinct users, and each of them can have a different password and a different set of privileges.

    0 讨论(0)
提交回复
热议问题