how to back uop all databases at once using mysqldump - mysql

I am trying to back up all databases at once from mysql server but i am getting the following error:
mysqldump: unknown option '--no-beep'
the command i am running is the following:
"C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump" --uXXXXX --pXXXXXX --all-databases > c:\MySQL_DB_Backups\%mydate%_all_databases.sql
Any help is appreciated.
thank you.

Fixed by commenting the line in my.cnf where it says "no beep"
[Client]
#no Beep

Related

Getting mysqldump: [ERROR] unknown variable 'column-statistics=0' when exporting database though shell in MAMP

I am trying to export a database in mysql from Mac terminal using
/Applications/MAMP/Library/bin/mysqldump -u root -p databasename tablename > /Users/mir/Documents/data.sql
It's giving me an error mysqldump: [ERROR] unknown variable 'column-statistics=0'
I have tried many solutions like
(i) adding "--column-statistics=0" in the query itself and
(ii) adding
[mysqldump]
column-statistics=0
in my.cnf at /Applications/MAMP/conf/my.cnf.
Nothing solve the issue.
Looking for help.
Find your my.cnf file using command in terminal "locate my.cnf"
My case I put
[mysqldump]
column-statistics=0
in /Applications/MAMP/conf/my.cnf to solve the issue.

What's wrong with mysqldump?

What's wrong with mysqldump -you type command "C:\MySQL>mysqldump --help"
It's displayed:
mysqldump: unknown option '--no-beep'
No matter you type with mysqldump, it always responses:
C:\MySQL>mysqldump
mysqldump: unknown option '--no-beep'
Thanks,
--no-beep is an option for the mysql command-line query tool, not for mysqldump.
I would guess that you have entered the no-beep in your my.cnf configuration file under the [client] section, which applies to both mysql and mysqldump clients. You need to move no-beep to the [mysql] section of the config file, so it applies only to the mysql client.
Before mysqldump ran well, but after MySQL was upgraded, this tool does not work. Where is the problem? No matter you type in the command with mysqldump, it always responses "mysqldump: unknown option '--no-beep'"
Commented out (#) the no-beep line in the MySQL my.ini, solved the problem.
See: mysqldump unknown option no beep

Trouble restoring mysql database from a backup

Friends, I have kept on tying and trying to restore a mysql database from a backup I created with mysqldump. I have been using this code (run in a command prompt Win XP and Win 7)
"C:\Program Files\MySQL\MySQL Server 5.5\mysql --user=root --password=password --host= localhost --port= 3306 --database=dbname < C:/Backup/dbname.sql"
I get "The filename, directory name, or volume lable syntax is incorrect" error messsage. I have googled for this error to no avail as to do with mysql.
*My mysql server is up and running with no problem. (Even the mysqldump command works)
*Problem is the same even if I open the command prompt from C:\Program Files\MySQL\MySQL Server 5.5\mysql
*I have tried to remove "", did not help.
*I have tried to use back slashes () instead of (/), did not help.
For this one, I will really appreciate any help. What is the problem here? what is this filename,directory name.... syntax error?
Thank you.
I think this is because you have quoted the whole command when you only need to quote the program name because there is a space in the path
Also the path for the backup file looks like it has "/" in place of "\"
Should be more like (assuming the options are correct:
"C:\Program Files\MySQL\MySQL Server 5.5\mysql.exe" --user=root --password=password --host= localhost --port=3306 --database=dbname < C:\Backup\dbname.sql
You can quit the file you're trying to execute from the command line and instead log in in MySQL and once inside do:
source C:/Backup/dbname.sql
Open Command Prompt and type this
cd C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin
Press Enter
or,
Directly open this directory "C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin" and Press LEFT SHIFT KEY from keyboard and RIGHT CLICK on the Directory Window.
Type this
mysql -u root -p12345 -h localhost ""DATABASE_NAME"" < e:\tmp.sql
It will work 100% correctly

MySQL database - error when backup database

When i try do database backup in Linux i got this error,
"Got error: 1296: Got error 157 'Unknown error code' from NDBCLUSTER when using LOCK TABLE"
can someone please guide me what i have to do to solve this error.
Thanks.
Execute the following from the linux shell to make a database dump (backup)
mysqldump -p -u[username] --no-lock-tables [database]>dumpfile.sql
replace [username] and [database] with the appropriate credentials of yours, like:
mysqldump -p -uroot --no-lock-tables mydb>dumpfile.sql

MySQL - How do I run commands on Windows?

I have a Win7 machine running PHP/MySQL/Apache and I have MySQL Administrator, MySQL Manager for MySQL installed along with a few other tools like Toad MySQL 6.0...
I was looking for a solution for some utf-8 issues I've been having and the majority of solutions (ie this one) say to run a set of commands such as mysqldump etc... But HOW do I run a command on a windows machine? I've tried executing it as an SQL script, running from the Windows Run command like
"C:\Program Files\MySQL\MySQL Server 5.1\bin\" mysqldump MY_DB -uroot --opt --quote-names --skip-set-charset --default-character-set=latin1 >c:\MY_DB_latin1.sql
but without luck. Any suggestions would be very helpful.
The problem is the space between "C:\Program Files\MySQL\MySQL Server 5.1\bin\" and mysqldump. This should read "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump".
Adding the .exe is optional: "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump.exe".
If you want to execute MySQL commands instead of dumping the database you should use mysql.exe: "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.exe". Use the -? option to get an overview of the command line options.
you have a space before mysqldump which is not required.
Also it should be mysqldump.exe
Win+R -> cmd -> OK
is a Windows command line.
Here you can type (assuming that C:\Program Files\MySQL\MySQL Server 5.1 is a correct path to your MySQL directory and MY_DB is your database name):
"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump.exe" MY_DB -uroot --opt --quote-names --skip-set-charset --default-character-set=latin1 >c:\MY_DB_latin1.sql
Here, you'll be able to see the output (most likely you will need -uroot -p, because your root account is password-protected, isn't it?).
If you'd like to paste a command, right-click and select "Paste" - Ctrl-V won't work here.