473,395 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

mysqldump not working in my batch file

I have my database stored with root user and a blank password
I want to schedule a regular backup of my database thus using batch file to create one.
My batch file goes like this
c:\xampp\mysql\bin>mysqldump -u root -p sampledb > e:\backup\backup.%date:~1
0,4%%date:~7,2%%date:~4,2%.sql
This command is working absolutely fine in CMD.
But after putting it in .bat a backup.date file is created at destination.
Further more file type is of DATE and size is Zero.
Please help me out in creating a batch file.
I have seen some of the discussions where it was suggested to put my mysqldump path into double quotes. I have tried this but got nothing else than a vain.
How should I enter my password as blank.
May 1 '14 #1
4 2624
Luuk
1,047 Expert 1GB
Leave out the '-p'.

Because you do not have a password, it makes no sense asking for one..... ;-)
May 1 '14 #2
Thanx it has sovled one part of my query...
May 3 '14 #3
set hr=%time:~0,2%
if "%hr:~0,1%" equ " " set hr=0%hr:~1,1%
C:\xampp\mysql\bin\mysqldump.exe --databases sampledb --user=root --ignore-table=or.oporeal_controlpanel > e:\backup\backup_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%.sql

This is the command which has worked for me.
This is for all others who may face this kind of problem.
May 3 '14 #4
Luuk
1,047 Expert 1GB
a little warning about this:
It does not work if your date setting differs from that of guptaujjawal
Expand|Select|Wrap|Line Numbers
  1. C:\Users\Luuk>echo %DATE%
  2. zo 04-05-2014
My date setting is "dd-mm-yyyy"
May 4 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jason Shohet | last post by:
A user runs a .NET application that authenticates them against active directory (they're coming in over VPN so they don't log on to the network normally). Once they log in, I want to take their...
4
by: Z0gS | last post by:
I use the following code to run a batch file on the server side but it not working. The code is working fine on a c# window console program. Can anyone help me? Process myProcess = new Process()...
2
by: DB | last post by:
Hi All, I have to execute dos command containing batch file using asp.net application. Code for batch file execution is working properly when I tried it with console application but same code...
4
by: CliffKing | last post by:
I am trying to use Windows Task Scheduler to run a batch file for an already open MS Access database. Below is the syntax to the batch file: Batch file: DailySalesExport.bat REM This runs the...
1
by: mvdkwong | last post by:
What's the trick to running a batch file from VBA? I'm trying to call it using the Shell function but it's not working for me. If I double-click the batch file or run it from the command line it...
0
by: Elroyskimms | last post by:
I need to execute a batch file via ASP.Net. In my VB.Net code, I'm using System.Diagnostics.Process to call the batch file and its appropriate command line arguments. I'm using...
4
by: MLH | last post by:
SHELLing to run a batch file in a cmd window does not work with all batch files. Here are two examples... c:\windows\Doc_Dirs.bat ==DIR *. /s WinDirs.txt - and - c:\db\timnall\getconf.bat...
0
by: Vijay Kumar | last post by:
Hi, I have a batch file(test.bat) i wrote a command to rename a text file in this batch file. Both batch file and text files are in Network Shared Drive. I am trying to run that batch file from...
3
by: Mandragon03 | last post by:
I am using php 5.2.5 via a wamp server on my machine. I have created a web interface to a mysql database using php. The web interface has a link to a php file which calls a dos batch file like...
14
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my windows applicationm, i need to excute a batch file. this batch file throws some text and questions to the screen, i need to catch the standard Output, check if it's a question, in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.