In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Mysql backup failure case (1)
Environment:
OS: windows server 2012
DB:Mysql5.7.17
Question:
Mysql can make a successful automatic backup at 22:00 every night through the mysqldump command.
After 9: 00 in the morning, the automatic backup of bat files was performed separately. The backup reported an error. The error message is as follows:
C:\ Users\ Administrator > rem * * backup Start**
Mysqldump: [Warning] Using a password on the command line interface can be insec ure.
Mysqldump: Couldn't find table: "9-29-04.sql"
Error: the file was not found using the specified search criteria.
C:\ Users\ Administrator > rem * * backup End**
Problem analysis:
In the backup script, use% date:~0,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2% to get the current time, because there may be multiple backups in a day in the format of "year-month-day-hour-minute-second"
By reporting the error "mysqldump: Couldn't find table:" 9-29-04.sql ", we can see that there was a problem when using% time:~0,2% to get.
The problem reappears:
When the Cmd window executes echo% date:~0,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%, it is found that there is an extra space before hour 9, which causes the backup to fail.
C:\ Users\ Administrator > echo% date:~0,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%
2018-11-29-9-28-17
But it's normal to get hours from 10:00, and there are no extra spaces:
C:\ Users\ Administrator > echo% date:~0,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%
2018-11-29-12-29-54
The cause of the problem:
Get the hour through% time:~0,2%. If the current hour is in single digits, that is, 0-9 o'clock, a space will appear before the hour:
C:\ Users\ Administrator > echo% time:~0,2%
nine
C:\ Users\ Administrator > echo% time:~0,2%
twelve
Solution:
Replace the space before the hour with 0
C:\ Users\ Administrator > set hackers% timeconfusion 0. 2%
C:\ Users\ Administrator > set hashes% h: = 0%
C:\ Users\ Administrator > echo% date:~0,4%-%date:~5,2%-%date:~8,2%-%h%-%time:~3,2%-%time:~6,2%
2018-11-29-09-28-55
Welcome to follow my Wechat official account "IT Little Chen" and learn and grow together!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.