Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MYSQL用户从SSH设置主机权限_Mysql_Ssh - Fatal编程技术网

MYSQL用户从SSH设置主机权限

MYSQL用户从SSH设置主机权限,mysql,ssh,Mysql,Ssh,如何通过SSH为MySql设置用户主机权限 我在WebMin>MySQL服务器权限中为我的根用户意外设置了错误的域/ip。就像我进入主机允许远程访问,并把错误的地址。现在,即使是Webmin也无法使用凭据进入数据库。通过SSH登录到服务器 使用以下命令进入mysql: mysql --skip-grant-tables -u root -p 跳过授权表将导致mysql放弃此会话的特权系统 然后使用grant命令向根用户授予任何权限: grant all privileges on *.* to

如何通过SSH为MySql设置用户主机权限


我在WebMin>MySQL服务器权限中为我的根用户意外设置了错误的域/ip。就像我进入主机允许远程访问,并把错误的地址。现在,即使是Webmin也无法使用凭据进入数据库。

通过SSH登录到服务器

使用以下命令进入mysql:

mysql --skip-grant-tables -u root -p
跳过授权表
将导致mysql放弃此会话的特权系统

然后使用grant命令向根用户授予任何权限:

grant all privileges on *.* to 'root'@'my-host-or-ip'

通过SSH登录到服务器

使用以下命令进入mysql:

mysql --skip-grant-tables -u root -p
跳过授权表
将导致mysql放弃此会话的特权系统

然后使用grant命令向根用户授予任何权限:

grant all privileges on *.* to 'root'@'my-host-or-ip'