__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!/bin/bash
#
# This file is included by /etc/mysql/debian-start
#
## Check MyISAM and Aria unclosed tables.
# - Requires the server to be up.
# - Is supposed to run silently in background.
function check_for_crashed_tables() {
set -e
set -u
# But do it in the background to not stall the boot process.
logger -p daemon.info -i -t"$0" "Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables"
# Checking for $? is unreliable so the size of the output is checked.
# Some table handlers like HEAP do not support CHECK TABLE.
tempfile=$(mktemp)
# We have to use xargs in this case, because a for loop barfs on the
# spaces in the thing to be looped over.
# If a crashed table is encountered, the "mariadb" command will return with a status different from 0
#
# The first query will generate lines like.
# select count(*) into @discard from 'mysql'.'db'
# The second line will load all tables without printing any actual results,
# but may show warnings and definitely is expected to have some error and
# exit code if crashed tables are encountered.
#
# Note that inside single quotes must be quoted with '\'' (to be outside of single quotes).
set +e
# The $MARIADB is intentionally used to expand into a command and arguments
# shellcheck disable=SC2086,SC2016
LC_ALL=C echo '
SELECT CONCAT('\''select count(*) into @discard from `'\'', TABLE_SCHEMA, '\''`.`'\'', TABLE_NAME, '\''`'\'')
FROM information_schema.TABLES WHERE TABLE_SCHEMA<>"INFORMATION_SCHEMA" AND TABLE_SCHEMA<>"PERFORMANCE_SCHEMA"
AND (ENGINE="MyISAM" OR ENGINE="Aria")
' | \
$MARIADB --skip-column-names --batch | \
xargs -i $MARIADB --skip-column-names --silent --batch --force -e "{}" &> "${tempfile}"
set -e
if [ -s "$tempfile" ]
then
(
/bin/echo -e "\n" \
"Improperly closed tables are also reported if clients are accessing\n" \
"the tables *now*. A list of current connections is below.\n";
$MYADMIN processlist status
) >> "${tempfile}"
# Check for presence as a dependency on mailx would require an MTA.
if [ -x /usr/bin/mailx ]
then
mailx -e -s"$MYCHECK_SUBJECT" "$MYCHECK_RCPT" < "$tempfile"
fi
(echo "$MYCHECK_SUBJECT"; cat "${tempfile}") | logger -p daemon.warn -i -t"$0"
fi
rm "${tempfile}"
}
## Check for tables needing an upgrade.
# - Requires the server to be up.
# - Is supposed to run silently in background.
function upgrade_system_tables_if_necessary() {
set -e
set -u
logger -p daemon.info -i -t"$0" "Upgrading MariaDB tables if necessary."
# Filter all "duplicate column", "duplicate key" and "unknown column"
# errors as the script is designed to be idempotent.
LC_ALL=C $MYUPGRADE \
2>&1 \
| grep -E -v '^(1|@had|ERROR (1051|1054|1060|1061|1146|1347|1348))' \
| logger -p daemon.warn -i -t"$0"
}
## Check for the presence of both, root accounts with and without password.
# This might have been caused by a bug related to mysql_install_db (#418672).
function check_root_accounts() {
set -e
set -u
logger -p daemon.info -i -t"$0" "Checking for insecure root accounts."
ret=$(echo "SELECT count(*) FROM mysql.user WHERE user='root' and password='' and plugin in ('', 'mysql_native_password', 'mysql_old_password');" | $MARIADB --skip-column-names)
if [ "$ret" -ne "0" ]
then
logger -p daemon.warn -i -t"$0" "WARNING: mysql.user contains $ret root accounts without password!"
fi
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| bulgarian | Folder | 0755 |
|
|
| charsets | Folder | 0755 |
|
|
| chinese | Folder | 0755 |
|
|
| czech | Folder | 0755 |
|
|
| danish | Folder | 0755 |
|
|
| dutch | Folder | 0755 |
|
|
| english | Folder | 0755 |
|
|
| estonian | Folder | 0755 |
|
|
| french | Folder | 0755 |
|
|
| georgian | Folder | 0755 |
|
|
| german | Folder | 0755 |
|
|
| greek | Folder | 0755 |
|
|
| hindi | Folder | 0755 |
|
|
| hungarian | Folder | 0755 |
|
|
| italian | Folder | 0755 |
|
|
| japanese | Folder | 0755 |
|
|
| korean | Folder | 0755 |
|
|
| norwegian | Folder | 0755 |
|
|
| norwegian-ny | Folder | 0755 |
|
|
| polish | Folder | 0755 |
|
|
| portuguese | Folder | 0755 |
|
|
| romanian | Folder | 0755 |
|
|
| russian | Folder | 0755 |
|
|
| serbian | Folder | 0755 |
|
|
| slovak | Folder | 0755 |
|
|
| spanish | Folder | 0755 |
|
|
| swedish | Folder | 0755 |
|
|
| ukrainian | Folder | 0755 |
|
|
| debian-start.inc.sh | File | 3.41 KB | 0755 |
|
| echo_stderr | File | 27 B | 0755 |
|
| errmsg-utf8.txt | File | 810.93 KB | 0644 |
|
| fill_help_tables.sql | File | 2.04 MB | 0644 |
|
| maria_add_gis_sp_bootstrap.sql | File | 1.64 KB | 0644 |
|
| mini-benchmark | File | 9.37 KB | 0755 |
|
| mysql_performance_tables.sql | File | 1.91 KB | 0644 |
|
| mysql_sys_schema.sql | File | 604.98 KB | 0644 |
|
| mysql_system_tables.sql | File | 29.86 KB | 0644 |
|
| mysql_system_tables_data.sql | File | 3.25 KB | 0644 |
|
| mysql_test_data_timezone.sql | File | 10.17 KB | 0644 |
|
| mysql_test_db.sql | File | 1.73 KB | 0644 |
|
| wsrep.cnf | File | 3.39 KB | 0644 |
|
| wsrep_notify | File | 4.86 KB | 0755 |
|