siddheshsawant has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys...I am working on the MySQL-PERL project.I use to work on remote machine and I guess that machine got rebooted...Because of which I lost my database which was stored....I logged in ito MySQL and changed to my Database nightly_db.....Then I typed command show tables; and that showed me some error like this

ERROR 1018 (HY000): Can't read dir of './nightly_db/' (errno: 13)

so what would be the cause of such error??Any Idea? Thanks in advance !!!!

Replies are listed 'Best First'.
Re: problem with MySQL Tables
by ikegami (Patriarch) on Apr 15, 2010 at 17:46 UTC
    $ perl -le'print $!=13' Permission denied

    (Can vary by system)

      what is this ? How it gonna solve my query?
        It's a string representation of errno 13. It's the reason for the error your database is giving. Maybe you should fix it? This has nothing to do with Perl.
Re: problem with MySQL Tables
by CountZero (Bishop) on Apr 16, 2010 at 16:36 UTC
    There was a thread in the MySQL lists: NDB_FS appears on the SHOW DATABASES; API command and Re: NDB_FS appears on the SHOW DATABASES; API command and the error related to the fact that the database was stored under a folder which was not itself the name of a database. According to the MySQL engine "folder == database" and if this assumption is broken a similar error as yours is shown.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: problem with MySQL Tables
by scorpio17 (Canon) on Apr 16, 2010 at 13:16 UTC

    Rebooting a machine should not delete your data.

    But it's possible that the mysql server (mysqld) is not setup to automatically restart itself upon reboot. You can start it manually (on most unix systems) using a command like:

    /etc/init.d/mysqld start

    However, you'll probably need to be logged in as root to do this.