DBD::mysqlインストール時のエラー

  • エラー 1
Can't exec "mysql_config": No such file or directory at Makefile.PL line 454.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located

(原因・解決策)
mysql_configコマンドがない。libmysqlclient15-devパッケージをインストールする。

$ sudo aptitude install libmysqlclient15-dev
  • エラー 2
ERROR: Access denied for user 'root'@'localhost' (using password: NO). Can't continue test

(原因・解決策)
MySQLのrootユーザにパスワードが設定してある。一時的にノンパスにする。

mysql> set password for root@localhost=password('');
  • エラー 3
ERROR: Unknown database 'test'. Can't continue test

(原因・解決策)
testデータベースが存在しない。*1

mysql> create database test;

*1:DebianのパッケージでMySQLをインストールしたら、デフォルトでtestデータベースがなかった。