MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Tim McDaniel Date:March 10 2008 3:33pm
Subject:Re: No database selected error when running mysql_tzinfo_to_sql
View as plain text  
On Mon, 10 Mar 2008, 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

The MySQL 5.0 manual explains mysql_tzinfo_to_sql at
<http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html>
6.0 at <http://dev.mysql.com/doc/refman/6.0/en/time-zone-support.html>
looks to be the same.

Its example line is

     mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

There's a trailing "mysql", which specifies the "mysql" database.
It also specifies all zoneinfo, not "America/".

<http://dev.mysql.com/doc/refman/6.0/en/mysql-tzinfo-to-sql.html>
describes the 6.0 version in a little more detail.  Its examples also
specify the mysql database explicitly and use the whole zoneinfo database.
I know little about the whole situation, so you may well know better
than me, but I'd use the examples provided.

A later example, to see whether tables have been loaded, is

     SELECT COUNT(*) FROM mysql.time_zone_name;

> Funny thing is I know I've run this on 2 other servers with
> identical software without issue

Have you tried the SELECT command above to verify?  I don't know about
MySQL, but in other databases I've used, it's possible to specify a
default database to use on each session unless another database is
explicitly specified.  Brief reading says that ~/.my.cnf can be used
as an options file.

-- 
Tim McDaniel, tmcd@stripped
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