mariadb: Add timezone information to database
This commit is contained in:
parent
4ef795d02e
commit
9c44999682
2 changed files with 37 additions and 0 deletions
22
roles/mariadb/files/mysql_tzinfo_check.sh
Executable file
22
roles/mariadb/files/mysql_tzinfo_check.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
_timestamp=$(cat <<EOF | mysql -s
|
||||
SELECT
|
||||
UNIX_TIMESTAMP(UPDATE_TIME)
|
||||
FROM
|
||||
information_schema.tables
|
||||
WHERE
|
||||
TABLE_SCHEMA='mysql' AND TABLE_NAME LIKE 'time_zone';
|
||||
EOF
|
||||
)
|
||||
|
||||
if [ "$(rpm -q --queryformat "%{installtime}" tzdata)" -gt "$_timestamp" ]; then
|
||||
{
|
||||
echo "WARNING: MariaDB timezone data older than sytem timezones"
|
||||
echo ""
|
||||
echo "Run: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql"
|
||||
} 1>&2
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue