createuser'username' @'ip address' identified by'password' -- set ip address as %: user can log in from any address( not include localhost( 127.0.0.1 ) )
权限
分配权限给用户
1 2 3 4
grant all privileges on databasename.tablename to 'username'@'ip address' -- all can be replaced by other sql operations like select,update etc -- tablename can be replaced by * -- we can also append 'identified by new password' to set a different for this user