473,765 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

importing sql statements

Ike
I have a text file with about 90,000 insert statements (as below). Is there
an easy way I can get these into my mysql database in one fell swoop? Can
anyone tell me how and perhaps that the syntax is? Thanks -Ike

INSERT INTO `lastnames` VALUES ('OFFENBERGER') ;
Nov 10 '05 #1
1 1176
If the table is already available, you can do it this way from the console:

shell> mysql -u [username] -p[password] [database name] < [text file name]

If the table doesn't already exist, you should create it first.

Markus
Nov 11 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6244
by: Andrew Lowe | last post by:
Hi all, First off, I'm new to the Oracle world so please be gentle on me. Now down to the problem at hand. I support a CAD application that has an Oracle backend. I've been on site at my clients offices and got a dump of data, via TOAD, to bring back to my office. This has given me a file containing a large number of insert statements of the format: Insert into tgds.trip_bodies (ARRIVAL_TIME, ADJUSTED_ARRIVAL_TIME,...
1
2237
by: Steve George | last post by:
Hi, I have a scenario where I have a master schema that defines a number of complex and simple types. I then have a number of other schemas (with different namespaces) where I would like to reuse some of these master complex and simple types. This I believe will assist me in transforming between the master schema and the other smaller schemas that contain a subset of the elements in the master schema. I understand that I can import an...
1
4311
by: redneck_kiwi | last post by:
I am attempting to import data from a text file. There are many records to be imported and the raw file format is: "1 |010-5502-502 |16H1-7-3 |CONTACT, ELECTRICAL, 7/8in. |356.0000 |0.0000" "1 |03-06-1062 |16H3-5-1 |RECEPTACLE,FREE HANGING 6 CON.|1.0000 |0.0000" "1 |03-06-2061 |16H2-8-2 |PLUG, POWER CONNECTOR |3.0000 |0.0000" Obviously, a...
2
1365
by: serge | last post by:
Using some VB sample code on the Internet I have the following that works well and exports a set of records to an XML file: Dim oCmd, sSQL, oDom Set oDom = CreateObject("Msxml2.DOMDocument.4.0") Set oCmd = CreateObject("ADODB.Command") oCmd.ActiveConnection = "Provider=SQLOLEDB;Data Source=(local);Initial Catalog=TestXML;UID=sa;Password=123456"
12
2890
by: expect | last post by:
What's the big deal with importing text files? I have a 70 MB file to import and it's been one problem after another. I used the copy command and it appears that it's just not possible. I finally massaged the file into a .sql file and ran that using \i db.sql but that failed too because I overlooked ' in names like D'Adario. The other problem I encountered was that a numeric field had to have data in it, pg would not default to the...
1
1701
by: robert demo via AccessMonster.com | last post by:
I've done all the recommended things with workgroup security, creating a ..mde file, and splitting the application into a front end and, in my case, multiple backends. The problem is that users that have access to the application (thru the custom workgroup file) can import the tables into a blank database. My application has no queries and uses SQL statements in the VBA code to read/update table information. I have hundreds of SQL...
29
4227
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using System.Text.RegularExpressions; using System.Web; using System.Web.Caching;
2
7137
by: =?Utf-8?B?UGFycm90?= | last post by:
I have tried everything to import a C++ dll into a C# program without success. I can import the dll into another C++ program but not a C# program. I always get the message that it can't find the function in the specified dll. So it is finding the dll program but it can't find the entry statements. I know that in C++ environment a lib file is used for addressing the entry statements at link time. Obviously, it does not work in a C#...
2
2654
by: krishna.000.k | last post by:
file1.py ---------- a = 20 from abc import * print "Should this be printed when 'a' is alone imported from this module" file2.py ---------- from file1 import a
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.