In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.