Solved

error with mysqldump

Posted on 2006-11-15
6
1,971 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 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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

690 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