Solved

error with mysqldump

Posted on 2006-11-15
6
1,964 Views
Last Modified: 2012-05-05
Hi experts,

I am trying to backup my database on my linux box, but I keep getting this error:

mysqldump: Got error: 1045: Access denied for user 'vittoriomysql'@'localhost' (using password: NO) when trying to connect

This is done in a cron job and the command I run is:

mysqldump –opt -Q -u myusername –password=mypassword arp3 > /home/vittorioftp/mysql_backup/EuroDisplay_Arp3_`date +%Y%m%d`.sql

"myusername" is a mysql user that has access to the arp3 database, but it is not a user at linux level.

What could the problem be?

Thanks.
0
Comment
Question by:Vido81
  • 3
  • 3
6 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 500 total points
ID: 17945897
you should not have -password=

-pmypassword

should work

alternativley you may not have permissions on localhost - have you checked this?
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 17945918
Above may or may not solve the problem -
http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html


You can login and use the grant syntax to make sure that myusername has the correct privledges
http://dev.mysql.com/doc/refman/5.0/en/grant.html
0
 

Author Comment

by:Vido81
ID: 17945922
Thank Raynard7,

that was a quick reply.

I think we are getting there... Here is the error I get now:

mysqldump: Got error: 1049: Unknown database '?opt' when selecting the database

I actually don't know what the -opt -Q options do, so I could get rid of them.

I just need to create a full backup of the arp3 table and put it on that folder...

Thanks.

Vittorio
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 35

Expert Comment

by:Raynard7
ID: 17945951
mysqldump -u myusername –pmypassword --tables databaseName.arp3 > /home/vittorioftp/mysql_backup/EuroDisplay_Arp3_`date +%Y%m%d`.sql

hi - above should work - provided you replace the databasename with the name of the databse.
0
 

Author Comment

by:Vido81
ID: 17945960
Raynard7, the name of the database is arp3...
0
 

Author Comment

by:Vido81
ID: 17945971
Thanks, it's now working. I took away the -opt
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now