?
Solved

error with mysqldump

Posted on 2006-11-15
6
Medium Priority
?
1,997 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 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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
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…
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

830 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