wk SQL list find blog view edit

Dump/Restore



#!/bin/sh
mysql -p -e "SELECT DISTINCT CONCAT(
  'SHOW GRANTS FOR ''', user, '''@''', host, ''';'
  ) AS query FROM mysql.user" > .users
cat .users | mysql -p | \
sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'
rm -f .users



cd /var/lib/mysql;rm -rf *;mysql_install_db;rm ibdata1;chown -R mysql:mysql *;mysqld --bootstrap