Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7504735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:40:13+00:00 2026-05-29T21:40:13+00:00

I would like to know the command to perform a mysqldump of a database

  • 0

I would like to know the command to perform a mysqldump of a database without the prompt for the password.

REASON:
I would like to run a cron job, which takes a mysqldump of the database once everyday. Therefore, I won’t be able to insert the password when prompted.

How could I solve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:40:14+00:00Added an answer on May 29, 2026 at 9:40 pm

    Since you are using Ubuntu, all you need to do is just to add a file in your home directory and it will disable the mysqldump password prompting. This is done by creating the file ~/.my.cnf (permissions need to be 600).

    Add this to the .my.cnf file

    [mysqldump]
    user=mysqluser
    password=secret
    

    This lets you connect as a MySQL user who requires a password without having to actually enter the password. You don’t even need the -p or –password.

    Very handy for scripting mysql & mysqldump commands.

    The steps to achieve this can be found in this link.

    Alternatively, you could use the following command:

    mysqldump -u [user name] -p[password] [database name] > [dump file]
    

    but be aware that it is inherently insecure, as the entire command (including password) can be viewed by any other user on the system while the dump is running, with a simple ps ax command.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if they are a specific command for ClearCase which
I would like to know if there is a way to run a command
i would like to know command to autofill foreach loop syntax as we can
I would like to know exactly how the Is command works in Linux and
I would like to know if there're a command to drop every databases from
I would like to know how to execute a system command from an android
I would like to know which keys (or keystrokes) would you use to replace
I would like to know how to view special characters while using 'less' command.
I would like to know if there is a DOS-Command in WinXP to create
I would like to know how to perform multiple commands in a list comprehension.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.