?
Solved

error with mysqldump

Posted on 2006-11-15
6
Medium Priority
?
1,979 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 2000 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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