Backing up Mysql Database on a Windows Machine

Discussions Involving The Rice Lake Programmable Scale System and other programmable scale indicators such as the Fairbanks FB3000

Backing up Mysql Database on a Windows Machine

Postby jrusso on Wed Sep 16, 2009 7:51 am

It took me a while to get this because I was getting mysqldump error 1064 but if you wish to back up your MySql database ( using mysqldump ) as a scripted/text file it is simple really.

Go to your command prompt (not the mysql command prompt but the DOS command prompt ie Run CMD) and go to the

Programfiles directory where you have mysql installed and go to the bin directory.

It should look something like this

C:\Program Files\MySQL\MySQL Server 5.0\bin>

To get here you can just type “cd C:\Program Files\MySQL\MySQL Server 5.0\bin>”
Once here use the following syntax

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqldump -u root –p<your password (no space between the –p and your password)> <databasename> > c:\backupfile.sql

This will leave a backupfile named backupfile.sql on your C:\ drive

For kicks here is a real life example

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqldump -u root –pPassword master > c:\temp\master_backup.sql

Running Mysql Script from a file ie,, restoring from the backup file discussed above

run script file with mysql
Note that if you need to create the database first before running the file this way
To do so you must run the Mysql Command Client
Start /All Programs / Mysql Server 5.0 / Mysql command line client

Login
type "Create Database Databasename;" without the "'s


from Windows Command Prompt (start run cmd)

go to directory

c:\Program Files\MySQ\Mysql Server 5.0\bin

then at the prompt type

mysql -u root -pPassword Tablename < c:\sqltextfile.txt

then press enter. That shoud be it.

Thanks and if you ever need a weighing system or food processing software or bar code systems call us
jrusso
Site Admin
 
Posts: 17
Joined: Fri Jan 11, 2008 10:10 am

Return to Rice Lake 920i and Other Programmable Scale Indicators

Who is online

Users browsing this forum: No registered users and 1 guest

cron