Christopher Shennan's Blog

A day in the life of…

I recently had to back up a MySQL database on a windows server so I could restore it to my local MySQL server for analysing the structure of an existing site which we are going to be rebuilding. I have done this hundreds of times on linux server but the usual command did not appear to work on this windows server. I was using:-

mysqldump -uroot -pPASSWORD database > c:\database.sql

but when I ran this I was presented with an “Access Denied” message.

My first thought was that the MySQL database username and password that I was using was incorrect, however this message refers to not having permissions to create the file c:\database.sql.

Once I realised this was a file permissions problem and not a database permissions problem I changed the path to one I knew I had write access on and the database exported without any problems.

About Christopher Shennan

I am a web developer specialising in web driven applications using PHP, MySQL, Symfony and Zend and I am currently working for Line Digital in Edinburgh, Scotland.

Most days I can be found frantically coding away with EuroDance in my ears and consuming what I hope to be a never ending supply of coffee... happy days!

Connect with me via Twitter, Google+ or LinkedIn

  • #1 | Written by Pooja about 2 years ago.

    right click on cmd.exe and open it as Administrator. Now run your mysqldump command. This definitely works.

  • #2 | Written by Christopher Shennan about 1 year ago.

    Hi Pooja,

    That would work but if I can recall correctly I was a limited user without access to a full administrator login on the windows server and therefore couldn’t perform that action. The method details above allowed me to work around that limitation.

    Many thanks.

    Chris.

No trackbacks yet.

Leave a Comment

Subscribe to comments

CommentLuv badge