mysql -u root -pvmwaremysql>use mysqlmysql>update user set host = '%' where user = 'root'mysql>select host, user from user
2.授权法。例如,你想用户myuser使用密码mypassword通过ip地址连接到mysql服务器,使用:
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION
IP是vachar。所以用
'select
*
from
'table'
where
ip
="
'
.$iipp.
'
"
'
为了好看。所以单引号和双引号之间打了空格,你用的时候要去掉空格
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)