mysqldump: Got error: 1044
-
I have a "database dump" file I have for each of my websites. It was given to us by a Linux/WHM/cPanel admin.
I receive emails from this daily for the same error:
mysqldump: Got error: 1044: Access denied for user 'ourusernamehere'@'localhost' to database 'information_schema' when using LOCK TABLES
Database Dump: [COMPLETE]According to this website I shouldn't be trying to backup the "information_schema" database.
#!/bin/bash USER="xxxx" PASSWORD='yyyy' DBNAMES="`mysql --user=$USER --password=$PASSWORD --batch -N -e "show databases"`" DB_DUMP_LOCATION=`pwd` function cool_progress_ind { chars=( "-" "\\" "|" "/" ) interval=1 count=0 while true ; do pos=$(($count % 4)) echo -en "\b${chars[$pos]}" count=$(($count + 1)) sleep $interval done } function stop_progress_ind { exec 2>/dev/null kill $1 echo -en "\n" } cool_progress_ind & pid=$! trap "stop_progress_ind $pid; exit" INT TERM EXIT for i in $DBNAMES; do /usr/bin/mysqldump --user=$USER --password=$PASSWORD --opt --add-drop-table --add-locks --quote-names --extended-insert --compatible=mysql323 $i > $DB_DUMP_LOCATION/$i.sql && gzip -f $DB_DUMP_LOCATION/$i.sql done stop_progress_ind $pid echo "Database Dump: [COMPLETE]"
Hopefully someone can tell me where I can exclude the "information_schema" database.
-
@technobabble pretty sure I didn't wrap the code correctly...if you tell me how I will edit it.
-
There are not <> tags in MangoLassi. If you want to do code, just indent the whole thing with four spaces.
-
The easiest way to do it is to pop the code into Notepad++ and under Edit select the Indent option and it will do it automatically for you. Then you can just paste it here.
-
@scottalanmiller said:
The easiest way to do it is to pop the code into Notepad++ and under Edit select the Indent option and it will do it automatically for you. Then you can just paste it here.
That's a lot of work.. Maybe we can get a GUI option for that.
-
There we go. Edited it for you.
-
@thecreativeone91 said:
That's a lot of work.. Maybe we can get a GUI option for that.
Feature requests can be posted directly to the developers over at community.nodebb.org. Posting there directly gets a lot of attention.
-
Thank you @steve for the rewrite. Thanks to @scottalanmiller for the how to!
-
@technobabble said:
Hopefully someone can tell me where I can exclude the "information_schema" database.
-
Does anyone know how I can edit this script to exclude a backup of the "information_schema" database?
-
According to the mysql website "do not dump the table code" is:
--ignore-table=db_name.tbl_name
Does anyone know if I just add that line after the /usr/bin/mysqldump line below?:
for i in $DBNAMES; do /usr/bin/mysqldump
Interesting...I made a red area in the code area.
-
@technobabble said:
Interesting...I made a red area in the code area.
automagic syntax highlighting. it knows that -- is a comment generally when starting a line of text.
-
Also, your credentials are in the post.
-
@JaredBusch Thanks man..fixed that.
Do you know where to add the code snippet?