Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/58.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.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 grunt从shell导入数据库_Mysql_Shell_Gruntjs - Fatal编程技术网

Mysql grunt从shell导入数据库

Mysql grunt从shell导入数据库,mysql,shell,gruntjs,Mysql,Shell,Gruntjs,我想使用gruntshell将数据库导入远程服务器 这就是我尝试过的: shell: { install_db: { options: { stdout: true, stderr: true }, command: [ "ssh user@demo.serv

我想使用
gruntshell
将数据库导入远程服务器

这就是我尝试过的:

shell: {
            install_db: {
                options: {
                    stdout: true,
                    stderr: true
                },
                command: [
                    "ssh user@demo.server.it mysql < /Volumes/www/database/mydb.sql --database db_test -u root -p password",
                ].join("&&")
            }
        }
我检索此错误:

Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
但我认为那个用户是对的。 我也尝试过:

"ssh user@demo.server.it mysql < /Volumes/www/database/mydb.sql --database db_test -u root -p",
“sshuser@demo.server.itmysql

“sshuser@demo.server.it",
“sudomysql
没事,它不会在我的远程服务器中导入我的sql文件

我已经创建了那个数据库


如何解决此问题?

我建议重置根密码,这在Windows 7、MySQL 5.5.37中非常有效

  • 停止MySQL进程/服务

  • 禁用授权表检查:

窗口中转到

C:\Program Files\MySQL\MySQL Server 5.5\my.ini
在Linux中

/etc/mysql/my.cnf
在[mysqld]部分下添加跳过授权表

[mysqld]
skip-grant-tables
  • 重新启动MySQL进程/服务

  • 转到MySQL提示符,您不需要用户/密码,因为您已经禁用了授权表检查

    C:>mysql

  • 执行以下命令,相应地替换“您的密码”

    更新mysql.user SET Password=Password('your_secret_Password'),其中user='root'; 同花顺特权

  • 退出MySQL提示符

  • 停止MySQL进程/服务
  • 启用授权表检查:从my.ini或my.cnf行中删除

    跳过赠款表

  • [mysqld]
    skip-grant-tables
    
  • 重新启动MySQL进程/服务


我使用的不是WIndows而是OSX,密码是否正确是另一个问题。我想尝试删除space-uroot-pyu密码
[mysqld]
skip-grant-tables