Visualizar todas as chaves estrangeiras (foreign keys) do banco de dados

SQL Pra listar todas as chaves estrangeiras criadas

select
CONSTRAINT_NAME as 'foreign_name',
concat(table_name, '.', column_name) as 'foreign _key',
concat(referenced_table_name, '.', referenced_column_name) as 'references'
from
information_schema.key_column_usage
where
referenced_table_name is not null;

OBS: Deve ter um jeito mais fácil, mas esse quebra bem o galho 😉

———————————————-
Posted Listening: “Hot for Teacher – Van Hallen”

Instalar Módulos PERL

Sempre que me deparava erros como o abaixo em um perl, quase chorava, agora graças ao totoro ficou bem simples!

Exemplo de erro:

Can’t locate FCGI.pm in @INC (@INC contains: /etc/perl /usr/lib64/perl5/site_perl/5.12.3/x86_64-linux /usr/lib64/perl5/site_perl/5.12.3 /usr/lib64/perl5/vendor_perl/5.12.3/x86_64-linux /usr/lib64/perl5/vendor_perl/5.12.3 /usr/lib64/perl5/site_perl /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/5.12.3/x86_64-linux /usr/lib64/perl5/5.12.3 /usr/local/lib/site_perl .) at /usr/local/bin/fastcgi-wrapper.pl line 3.
BEGIN failed–compilation aborted at /usr/local/bin/fastcgi-wrapper.pl line 3

Solução:

perl -eshell -MCPAN
install FCGI

OBS: Case sensitive (sim, tive problema com isso :P)

———————————————-
Posted Listening:  “Back to Madness – Stratovarius”