<legend id='5SEqt'><style id='5SEqt'><dir id='5SEqt'><q id='5SEqt'></q></dir></style></legend>
<tfoot id='5SEqt'></tfoot>

  • <i id='5SEqt'><tr id='5SEqt'><dt id='5SEqt'><q id='5SEqt'><span id='5SEqt'><b id='5SEqt'><form id='5SEqt'><ins id='5SEqt'></ins><ul id='5SEqt'></ul><sub id='5SEqt'></sub></form><legend id='5SEqt'></legend><bdo id='5SEqt'><pre id='5SEqt'><center id='5SEqt'></center></pre></bdo></b><th id='5SEqt'></th></span></q></dt></tr></i><div id='5SEqt'><tfoot id='5SEqt'></tfoot><dl id='5SEqt'><fieldset id='5SEqt'></fieldset></dl></div>
      <bdo id='5SEqt'></bdo><ul id='5SEqt'></ul>

        <small id='5SEqt'></small><noframes id='5SEqt'>

        任务计划程序中的 PowerShell MySQL 备份脚本错误

        时间:2023-06-07

        <legend id='XGivK'><style id='XGivK'><dir id='XGivK'><q id='XGivK'></q></dir></style></legend>
          <bdo id='XGivK'></bdo><ul id='XGivK'></ul>

          1. <i id='XGivK'><tr id='XGivK'><dt id='XGivK'><q id='XGivK'><span id='XGivK'><b id='XGivK'><form id='XGivK'><ins id='XGivK'></ins><ul id='XGivK'></ul><sub id='XGivK'></sub></form><legend id='XGivK'></legend><bdo id='XGivK'><pre id='XGivK'><center id='XGivK'></center></pre></bdo></b><th id='XGivK'></th></span></q></dt></tr></i><div id='XGivK'><tfoot id='XGivK'></tfoot><dl id='XGivK'><fieldset id='XGivK'></fieldset></dl></div>
          2. <small id='XGivK'></small><noframes id='XGivK'>

                <tbody id='XGivK'></tbody>

              • <tfoot id='XGivK'></tfoot>

                  本文介绍了任务计划程序中的 PowerShell MySQL 备份脚本错误 0x00041301的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我创建了以下 PowerShell 脚本.

                  I have created the following PowerShell script.

                  $root = 'C:\Backups\My Website\Database Dumps\'
                  
                  $dateString = (Get-Date).ToString("yyyy-MM-dd")
                  
                  $fileName = $dateString + "-MyWebsiteDbBackup.sql"
                  
                  $backupFilePath = ($root + $fileName)
                  
                  $command = ("mysqldump -u root wpdatabase > " + "`"$backupFilePath`"")
                  
                  Write-Host $command
                  
                  Invoke-Expression $command
                  

                  它的功能应该是为我的 WordPress 网站制作 MySQL 数据库的每日备份.

                  Its function is supposed to be making a daily backup of a MySQL database for my WordPress website.

                  当我在 PowerShell ISE 中运行脚本时,它运行良好,并且创建的 MySQL 转储文件没有问题.

                  When I run the script in PowerShell ISE, it runs fine and the MySQL dump file is created with no problems.

                  然而,在任务计划程序中,它被困在运行代码0x00041301.

                  However, in Task Scheduler, it was stuck on running with a code 0x00041301.

                  对于凭据,我使用了 my.cnf 技术 此处描述.而且我已经将任务设置为无论用户是否登录都运行.

                  For the credentials, I am using the my.cnf technique described here. And I've set the task to run whether a user is logged on or not.

                  代码更新

                  基于 vonPryz 的回答.

                  Based on vonPryz's answer.

                  $root = 'C:\Backups\My Website\Database Dumps\'
                  
                  $dateString = (Get-Date).ToString("yyyy-MM-dd")
                  
                  $fileName = $dateString + "-MyWebsiteDbBackup.sql"
                  
                  $backupFilePath = ($root + $fileName + " 2>&1")
                  
                  $command = ("mysqldump -u root wpdatabase > " + "`"$backupFilePath`"")
                  
                  Write-Host $command
                  
                  $output = Invoke-Expression $command 
                  
                  $output | Out-File C:\mysqlBackupScriptOutput.txt
                  

                  这现在给我一个错误,说路径中的非法字符

                  This now give me an error saying illegal character in path

                  我做错了什么?

                  推荐答案

                  Task Scheduler 的代码 0x00041301 意味着任务正在运行.这可能意味着 mysqldump 正在提示某些东西.也许是密码或一些确认对话框.正在运行任务的用户帐户是哪个?

                  Task Scheduler's code 0x00041301 means that the task is running. This is likely to mean that mysqldump is prompting for something. Maybe a password or some confirmation dialog. Which user account is the task being run on?

                  为了调试,您需要捕获进程的输出以查看发生了什么.尝试使用 Tee-Object 发送一个复制到文件中.

                  In order to debug, you'd need to capture the process' output to see what's going on. Try using Tee-Object to send a copy to a file.

                  这篇关于任务计划程序中的 PowerShell MySQL 备份脚本错误 0x00041301的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:服务器重新启动时 SQL Server 代理未自动启动 下一篇:如何授予 SQL Server 读取 SSL 密钥的权限?

                  相关文章

                  最新文章

                  <legend id='ZbT5o'><style id='ZbT5o'><dir id='ZbT5o'><q id='ZbT5o'></q></dir></style></legend>

                  <small id='ZbT5o'></small><noframes id='ZbT5o'>

                1. <tfoot id='ZbT5o'></tfoot>

                    <i id='ZbT5o'><tr id='ZbT5o'><dt id='ZbT5o'><q id='ZbT5o'><span id='ZbT5o'><b id='ZbT5o'><form id='ZbT5o'><ins id='ZbT5o'></ins><ul id='ZbT5o'></ul><sub id='ZbT5o'></sub></form><legend id='ZbT5o'></legend><bdo id='ZbT5o'><pre id='ZbT5o'><center id='ZbT5o'></center></pre></bdo></b><th id='ZbT5o'></th></span></q></dt></tr></i><div id='ZbT5o'><tfoot id='ZbT5o'></tfoot><dl id='ZbT5o'><fieldset id='ZbT5o'></fieldset></dl></div>
                      • <bdo id='ZbT5o'></bdo><ul id='ZbT5o'></ul>