MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:dpgirago Date:March 10 2008 3:56pm
Subject:Re: No database selected error when running mysql_tzinfo_to_sql
View as plain text  
> On Mon, Mar 10, 2008 at 11:07 AM,  <dpgirago@stripped> 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); } ?>

Thanks Daniel. 

The command worked with this syntax:

root> mysql_tzinfo_to_sql /usr/share/zoneinfo/America/ | mysql -D mysql -u 
xxx -p xxx

Still curious though why the databse needed to be explicitly selected now 
when I don't recall having to do that before. 

mysql_tzinfo_to_sql surely must know which db.tables to update... 

--David.
Thread
No database selected error when running mysql_tzinfo_to_sqldpgirago10 Mar
  • Re: No database selected error when running mysql_tzinfo_to_sqlDaniel Brown10 Mar
    • Re: No database selected error when running mysql_tzinfo_to_sqlTim McDaniel10 Mar
      • Re: No database selected error when running mysql_tzinfo_to_sqlDaniel Brown10 Mar
  • Re: No database selected error when running mysql_tzinfo_to_sqlTim McDaniel10 Mar
Re: No database selected error when running mysql_tzinfo_to_sqldpgirago10 Mar
  • Re: No database selected error when running mysql_tzinfo_to_sqlTim McDaniel10 Mar
Re: No database selected error when running mysql_tzinfo_to_sqldpgirago10 Mar