[ncolug] Re: sql file

  • From: Rob Gibson <nosbig@xxxxxxxxx>
  • To: "ncolug@xxxxxxxxxxxxx" <ncolug@xxxxxxxxxxxxx>
  • Date: Fri, 14 Dec 2012 17:52:43 -0500

A SQL dump that has definitions and data for multiple tables should be able
to import multiple tables.  Have you tried the command I described earlier,
to place the "--show-warnings" option ahead of the "<" redirection operator?

Rob


On Fri, Dec 14, 2012 at 11:04 AM, Ken Allen <kc8tdw@xxxxxxxxx> wrote:

> Weather is the database and the sql file has multiple tables in it, it is
> only doing the first table.
>  On Dec 14, 2012 7:09 AM, "Rob Gibson" <nosbig@xxxxxxxxx> wrote:
>
>> I can't speak for the complete syntax, but two things stand out right
>> away...
>>
>> First, the --show-warning is a flag for the "mysql" command.  By placing
>> it at the very end of the command line, you are adding it to the list of
>> files to be fed into the "mysql" command for placing into your database.
>> When you are looking to use redirection to pull the contents of a file from
>> standard input and have file arguments, make sure the arguments are before
>> the redirection.  Try this:
>>
>> mysql -u root -p weather --show-warnings < hw3mysql.sql
>>
>> Second, I notice that no database is specified on the command line.
>> While the database you are interested in has only one table, is this the
>> only database on the MySQL installation?  I suspect not, and you will need
>> to specify that on the command line with another argument.
>>
>> Rob
>>
>>
>> On Fri, Dec 14, 2012 at 6:23 AM, Ken Allen <kc8tdw@xxxxxxxxx> wrote:
>>
>>> I have a large sql file that I am trying to put in a database, but the
>>> file is to big for myphpadmin, file size 13.5 mb.  So, I am doing command
>>> line now and it is sitting there, never ends.  Check the database and only
>>> one table is installed.  Here is the command I am running....
>>>
>>> mysql -u root -p weather < hw3mysql.sql --show-warnings
>>>
>>> Is there something I am doing wrong?
>>>
>>> I can make the file available for download if someone wants to look at
>>> the format.
>>>
>>> Thanks,
>>>
>>> Ken
>>>
>>
>>

Other related posts: