Disable dns lookups for mysql

In a small environment VPS or VDS, there’s very little reason to rely on DNS resolution inside MySQL.
You can disable it by adding ‘skip-name-resolve’ to your my.cnf (section mysqld) or by using the ‘–skip-name-resolve’ command line argument. Remember: If you disable DNS lookups, you will need to set permissions using IP addresses rather than host names!

DROP ALL TABLES в MySQL

The heading at this note is a bit wrong. In MySQL there is no such command, and it would be desirable, that it was. Sometimes there are problems in which we want to remove all tables of a DB, but not her (that there were its parametres, such as access rights, codings, etc.). To solve such problem it is possible with the help command:

a=name;b=pass;c=base;mysqldump -u$a -p$b --add-drop-table --no-data $c|grep ^DROP|mysql -u$a -p$b $c

The first command of the conveyor we create «dump» the databases, consisting of every possible DROP TABLE, but without the data. The second command we choose only the lines beginning with DROP, and at last, we fill in the received commands in MySQL.

Scroll to top