A
A
Alexander Kireev2021-07-06 10:53:24
MySQL
Alexander Kireev, 2021-07-06 10:53:24

Why does mysqldump create an empty file?

Good day to all. such a problem.
On Cpanel, I create a Cron task
mysqldump -u admin_name –pPassword_DB Name_DB > /Path/to storage/Dump_name.sql dump

result - an empty file with

.sql permission I rummaged through the Internet, mostly placing answers about creating a script under root. I don't have root access

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Mirilaczvili, 2021-07-06
@2ord

–pPassword_DB
There is some strange hyphen here.
I would try -p 'секретно'
(with a space after -p)
and make sure the host is correct. If not localhost, then add the key. -h example.com
If there is a problem with access rights, then the dump is not created, and then it is logical that the file is empty when redirected.
So first I would try to connect to the mysql console:
mysql -u admin_name -p 'секретно'
And if the connection is successful, then run the command with mysqldump.

D
Dmaw, 2021-10-29
@Dmaw

I had a file not empty but only some headers.
Installation of all rights to the user on a DB helped.
And the command does not work for me when there are spaces after -u or -p.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question