ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    mysqldump: Got error: 1044

    IT Discussion
    5
    14
    2.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      technobabble
      last edited by technobabble

      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.

      T 1 Reply Last reply Reply Quote 0
      • T
        technobabble @technobabble
        last edited by

        @technobabble pretty sure I didn't wrap the code correctly...if you tell me how I will edit it.

        1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          There are not <> tags in MangoLassi. If you want to do code, just indent the whole thing with four spaces.

          1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller
            last edited by

            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.

            ? 1 Reply Last reply Reply Quote 0
            • ?
              A Former User @scottalanmiller
              last edited by

              @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.

              steveS 1 Reply Last reply Reply Quote 0
              • steveS
                steve
                last edited by

                There we go. Edited it for you.

                1 Reply Last reply Reply Quote 0
                • steveS
                  steve @A Former User
                  last edited by

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • T
                    technobabble
                    last edited by

                    Thank you @steve for the rewrite. Thanks to @scottalanmiller for the how to!

                    1 Reply Last reply Reply Quote 0
                    • T
                      technobabble
                      last edited by

                      @technobabble said:

                      Hopefully someone can tell me where I can exclude the "information_schema" database.

                      1 Reply Last reply Reply Quote 0
                      • T
                        technobabble
                        last edited by

                        Does anyone know how I can edit this script to exclude a backup of the "information_schema" database?

                        1 Reply Last reply Reply Quote 0
                        • T
                          technobabble
                          last edited by technobabble

                          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.

                          JaredBuschJ 1 Reply Last reply Reply Quote 0
                          • JaredBuschJ
                            JaredBusch @technobabble
                            last edited by

                            @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.

                            1 Reply Last reply Reply Quote 0
                            • JaredBuschJ
                              JaredBusch
                              last edited by

                              Also, your credentials are in the post.

                              T 1 Reply Last reply Reply Quote 0
                              • T
                                technobabble @JaredBusch
                                last edited by

                                @JaredBusch Thanks man..fixed that.

                                Do you know where to add the code snippet?

                                1 Reply Last reply Reply Quote 0
                                • 1 / 1
                                • First post
                                  Last post