View Single Post

   
  #2 (permalink)  
Old 03-10-2008, 05:55 PM
Daniel Brown
 
Posts: n/a
Default Re: No database selected error when running mysql_tzinfo_to_sql

On Mon, Mar 10, 2008 at 11:07 AM, <dpgirago@mdanderson.org> wrote:
> I'm getting an error trying to run this command:
>
> root> mysql_tzinfo_to_sql /usr/share/zoneinfo/America/ | mysql -u xxx -p
> xxx
>
> ERROR 1046 (3D000) at line 1: No database selected


mysql -D mysql -u xxx -p < mysql_tzinfo_to_sql /usr/share/zoneinfo/America/

The -D flag selects the database `mysql`, which is where the time
zone information belongs. The < redirect reads from the "file"
(which, in this case, is actually a redirected STDOUT) into the
database.

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
Reply With Quote