Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Import Only 1 Database From A Mysqldump File


i like to import only one Database include 37 Tables from a dumpfile. But i must be shure that only this one Database is imported. The dumpfile include more Databases (70) with >1500 Tables

Can i use this --database=onlyforum option for mysql ?

mysql -hlocalhost -uuser -p --database=onlyforum < alldatabases.sql

ore is there a other option to use?




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
How Do I Import .csv File Into My Mysql Database?
I woould like to know how to import csv files into my mysql databse, I tried the:

LOAD DATA LOCAL INFILE '/importfile.csv'
INTO TABLE test_table
FIELDS TERMINATED BY ','
LINES TERMINATED BY ''

Commands but I dont know where would i put these command and wher do put the "importfile.csv", what directory and location?

View Replies !   View Related
Import .xls File Into A Mysql Database
I have a .xls file that i would like to import into a mysql database, I am ok creating the mysql table in phpmyadmin on my webspace but i cant work out or find any useful tutorials on how to import the database from the .xls format and get it into the database short of building a form and submitting by hand which would take far to long.



View Replies !   View Related
Import Excel File To Database
to import an excel file into a database making sure the cells in excel go to the correct rows in the mysql database?

View Replies !   View Related
How To Import Excel File Into An Already Normalized Database?
I have a problem with the issue in the subject, i have all data in one big excel file, in a denormalized form, and on the other side, i have mysql database with many tables, which is already in production, and it is of course in the 3rd NF. How do i go about importing that excel file , is there any good tool i could use to handle prim/foreign key issues for me?

View Replies !   View Related
Import Excel File Into Mysql Database
I was looking for information on how to import an excel file or other text file into a MySql database. I have done this with both access and SQL Server and am looking for a way to do this in MySql. I have several hundred items i want to import into a parts database that is currently in an excel file but can be saved as comma separated or other format.

View Replies !   View Related
How To Import Csv File (generated By Openoffice) To Mysql Database?
how to import csv file (generated by openoffice) to mysql database?

View Replies !   View Related
Dump File Import :: #1046 - No Database Selected
I've a dump file of mysql. But when i want to import it shows me a error message.........

--
-- Table structure for table `ADMIN`
--

DROP TABLE IF EXISTS `ADMIN` ;

#1046 - No database selected

View Replies !   View Related
Mysqldump :: Bin/mysqldump: Got Error: 1: Can't Create/write To File
When executing the following command:

bin/mysqldump -u root -p -T /Users/bj/Desktop/ tfc

The following error appears:

bin/mysqldump: Got error: 1: Can't create/write to file '/Users/bj/Desktop/acts.txt' (Errcode: 13) when executing 'SELECT INTO OUTFILE'

However, it does write the 'acts.sql' file which one of the files in the tfc database.

I suspect this has something to do with permissions, but even when I run this as 'unix root user' I get the same error.

View Replies !   View Related
Import A Mysqldump Using A Php Script?
One of my clients has just changed webhosts. The new host has a VERY limited administrative panel ... there is no cPanel, no phpMyAdmin, etc. I have to import the mysql database, and am having difficulty doing so.

Is it possible to take a mysql dump and import the whole thing using a php script? If so, how can I do this. Any advice appreciated?

View Replies !   View Related
Mysqldump Or Import Does Not Work Correctly
@first, here are my stats:
- win2k3 / MySQL 5.0.37
- AIX 5.2 / MySQL 5.0.26

I am not a real newbie but not a crack, too ... Well, I try to replicate my db from a win2k3 server to a AIX 3.2 Server, but it doesn#t work correctly ...

I am using cacti tool for displaying my data as graphs ... and now I want to copy my data regulary from one machine to the other ...

this is the way I do this:

mysqldump cacti --user=root -p > cacti.dump
**copy via ftp**
mysql --user=root -p cacti < cacti.dump

There are no error messages displayed, but I do only have some "old" data from months ago in my cacti db, but the original db is filled up to date ...

What might be the problem ? Overwriting all files in $MYSQL_HOME$/data/cacti didn't work, too ... Is this a problem with the application perhaps, that data is different between windows and AIX ?

View Replies !   View Related
Mysqldump Import :: ERROR 1292 (22007): Incorrect Datetime Value
Hello everyone, I have problems with the import of a dump file

CREATE TABLE `tabella` (
`IDtabella` int(4) unsigned NOT NULL auto_increment,
`data` datetime default NULL ,
PRIMARY KEY (`IDtabella`)
) ENGINE=innoDb DEFAULT CHARSET=latin1;

INSERT INTO `tabella` VALUES ('1','20021101 00:00:00');

:error:
ERROR 1292 (22007): Incorrect datetime value: '20021101 00:00:00' for column 'data' at row 1

I thought was the invalid date (there also dates like this: 00000000 00:00:00)
but setting the session:

SET SQL_MODE='STRICT_TRANS_TABLES,ALLOW_INVALID_DATES';
or
SET SQL_MODE='';

nothing changes (no import or right import)

The problem seems to be the date format in the file, if I change the date in this format:
INSERT INTO `tabella` VALUES ('1','2002-11-01 00:00:00');

in practice, i manually add the symbol "-" between years-month-day data is imported correctly

The problem, is that the file dump is 139Mb!!

View Replies !   View Related
Mysqldump File
I know I knew how to do this, and I know that I found it somewhere in the manual, but it's Monday and I'm heading out so I thought I'd ask you all and hopefully have an answer when I get back on Tuesday so I can stop banging my head against the keyboard.
Recently set up mysql 4.0.20a on a development machine to try and upgrade to 4.1 before I blow up the live database and I make an hourly dump form the live database using mysqldump.I grabed the latest dump and moved it to the development machine but I can't for the life of me recall how to take that file and make it create all the database, tables, and data on the new install.
Any thoughts linkage to the right portion of the MySQL manual definatly acceptable
As an aside, did anyone else find the MySQL page to be extremely slow today (2/7/2005)


View Replies !   View Related
Mysqldump Backup To More Than One File
We currently use mysqldump to dump all our db's in quick mode to one
file, backup.sql. This file has come quite large.

mysqldump -Aq -u root > /MySQL/backup/backup.sql

I would now like to split the mysqldump so that the output comprises
of several files of less than 2 gigabytes each. Does anyone know the
mysqldump options that could be used to do this? Or with using the >
out command?

View Replies !   View Related
Numbers In A Mysqldump File Mean
In mysqldump files there are numbers and settings preceding the insert data.

/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

I can figure out what the settings do but what do the numbers mean? Is there a reference that lists all the numbers?

View Replies !   View Related
Mysqldump Gzip File
I'm trying to use mysqldump from php.

Here is the php im using for this:

$dbhost, $dbuser, $dbpass are present, but not show for security reasons.

$path = "/home/a/c/acornmedia/public_html/tools/sqlmagic/backup/";

$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';

$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $path . $backupFile";
system($command);

I'm not sure about the $path section, the person that commented on a different post wasn't clear whether this was the path to where the db should be moved to once gzipped, or where the db where it is dumped before its gzipped.

View Replies !   View Related
Not Able To Read Mysqldump File Thru CLI
I am trying to do something like below

mysql -u root -p poll_only < poll.sql

poll.sql is a reasult of mysqldump nad i am trying to run and populate the database poll_only .

but nothing works out i am getting error
Access denied for user: 'root@localhost' to database 'poll_only'

i had given GRANT ALL poll_only.* username@localhost

but still no effect

View Replies !   View Related
Sheduled Mysqldump Via Windows Bat File
I want to make a scheduled task in windows to do a mysqldump. Someone gave
me this .bat to run but I'm not able to get it to work.

REM @echo off

for /f "tokens=1" %%i in ('date /t') do set DATE_DOW=%%i

for /f "tokens=2" %%i in ('date /t') do set DATE_DAY=%%i
for /f %%i in ('echo %date_day:/=-%') do set DATE_DAY=%%i
for /f %%i in ('time /t') do set DATE_TIME=%%i
for /f %%i in ('echo %date_time::=-%') do set DATE_TIME=%%i
C:Program FilesMySQLMySQL Server 4.1in
mysqldump -u user -p'pass' dbname >C:DATE_DAY%_%DATE_TIME%_database.sql

When I run this script it doesn't work. All I get is a blank .sql file in
the output directory.

View Replies !   View Related
Mysqldump Produces An Empty File
i am having a problem with mysqldump.i am running this script from the
shell

root@linuxserver:/usr/local/mysql#bin/mysqldump u im_backup --opt
inventory /home/all/sqlbu/inv_'date +%F.sql

(user=imbackup
dbase name = inventory)

i don't know what am i missing or what's the problem with this line
since it generates only an empty file...

i created the user im_backup granting all privileges. There was no
error messages too.. what's the problem w/ this?

View Replies !   View Related
Mysqldump :: Read Password -p From .cnf File?
I want to do a simple mysqldump of a database. I know I can set up a cronjob to point to a script that runs

mysqldump -u username -pXXXXXXX db_name >mysql.backup

however I'm not happy with putting the password in the script. I've seen some suggestions on the web that you can use '-p hidden' and that this somehow reads from a .cnf file?

Am I worrying unecessarily here? I've looked through a number of books, but can't find a simple answer/ procedure to this.

View Replies !   View Related
Import .sql File
I am working with mysql for the first time. I figured I would try to learn a little about it by creating a Cacti SNMP monitoring server. I have created a database in mysql called cacti. The root password is also cacti. I have been fighting with importing the included cacti.sql file for days. I have tried multiple syntaxes and get the same error everytime. Here is what I have done:

mysql> mysql -u root -p cacti cacti < c:inetpubwwwrootcacticacti.sql;
ERROR:
Unknown command 'i'.
Show warnings disabled.
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'acti.
sql' at line 1

I am sure this is a stupid mistake because everything I read makes it sound like importing .sql files is easy.

View Replies !   View Related
Import A Csv-file Via Www
I have a php-page whitch checks and updates a database. I want to make it possible for users to import a csv-file into the database.
Does anyone know how to fix this?

View Replies !   View Related
Import CSV File
I should import a csv file into mysql table, so i write:

load data local infile <file name>
into table <Table name>
fields terminated by ','
enclosed by '"'
lines terminated by '
';

However, I find that it is time consuming for writing the query "fields terminated..............by '
'"
since I should import the csv many time.

So can I modify the default value of "fields terminated by" so that I could omit that part when I import the file?

View Replies !   View Related
Import A .sql File
Ok, probably any easy task but not having much luck here. i exported to an .sql file a database from phpmyadmin. now, what i want to do is use that file to recreate the database on my local test machine. i do not have phpmyadmin installed on this system, so am looking for the proper query i can use at mysql command line to run.

View Replies !   View Related
Timestamp Issue Importing From Mysqldump File
I am moving data (all my schemas/tables) so I data dumped them. Here's one of the statements.

INSERT INTO 'tablename' VALUES (12, 'a', 'b', 'c', 2008-12-24 11:21:01);

I would get an error.

The new table is created but it says syntax problem with 2008-12-24 11:21:01

Why is that? I did try changing the field datatype to 'TEXT' from being 'TIMESTAMP' but I had to add the single quotes on each one of the statements.

Is there a way to export the data to have quotes on each of the timestamped records?

View Replies !   View Related
Mysqldump: Got Errno 27 On Write. File Too Large
I have musql 4.1.7 on Solaris 9, 64 bits and I want to mysqldump a +-4 gigas db.

The dump I want to do is from a myISAM tables databank. I used to do that dump wihtout any problem until recently while the size of the Db double (+-2 to +-4) Code:

View Replies !   View Related
Mysqldump And Reload To Trim Down The Ibdata1 File
I'm trying to execute a dump and reload to trim down the ibdata1 file.

I've done this before, and not encountered any (insurmountable) problems, but I'm stuck this time. I'm getting 'error code: 5 (HY000) Out of memory (needs 1.8GB)' when trying to reload back from the dump. So, I editted the dump file and hashed out that line, but had the same problem on the next line. I'm using bulk inserts of course (16GB dump file as is), but is it possible to make it a little less bulky? Or do I simply need to tweak some networking parameters?

I'm using sqlyog to make and reload the dump for convenience, but can do it from command line if necessary.

The computer I'm using has 2GB of ram, which might be relevant.

View Replies !   View Related
Can I Use Mysqldump To Dump A Query Result Into A CSV File?
Can I use mysqldump to dump a query result into a CSV file?

View Replies !   View Related
Import A Text File
I have a utf8 txt file to import in a MySQL db, cause I must create a
web-application in PHP for reading this information on-line.
I have create a new DB in MYSQL 4.1.1a setting CHARACTER=utf8,
then I have create a table t1 with character set utf8 and some fileds
also with CHARACTER=utf8.
Then I imported the Txt file (really in UTF8 format, with 22600
records!) in my db. MySQL have imported the non-utf8 field correctly,
26000 records.
When I try to read this utf8 filed they appear like "???-?-???".
Then, also my PHP application show this field with stranges
characters. I have try also with PHPfunction utf8_encode with no
success

View Replies !   View Related
Import Text And Csv File
i want to import either text or csv file to database how can i do this..i have tried mysqlimport command but its giving some error

View Replies !   View Related
Import File With SQL Queries?
I have created a number of files that have ~1000-2000 SQL queries in them. I want to know if there is a way to import these files into the database through a script of some kind. At first I thought LOAD DATA INFILE, but that seems to be for a file that simply contains delimited data. I actually have INSERT SELECT WHERE etc... statements.

I don't want a script that reads the file and sends the commands individually ... it takes far too long. I have been importing them manually through phpmyadmin but I want to automate the process.

View Replies !   View Related
Fastest Way To Import A *BIG* .sql File
i've a big file with sql stataments: it's about 35 GB (about 2 GB if zipped).

What's the fastest way to import it into mysql? Is there a way to import it from the zip/bzip2 file?

View Replies !   View Related
Text File Import
I'm importing a large text file (8 million lines) into a mysql table via the heidisql front end. Each line has 42 fields (tab separated) so there's a lot of data to bring in.

I tested the import with a truncated version of the text file (10,000 lines) and the import worked fine. It took about a minute (i think) to import. Now though, the full version (which is 800x as long) has been importing for nearly 48 hours. Heidisql seems to be still working - it hasn't frozen, it's busy.

Is it normal for a file of this size to take so long to import?

View Replies !   View Related
How To Import Text File?
I am using MAMP and am trying to import a large text file (up to 30mb) that is defined by position i.e., space 1-8 = ID, space 9-14 = Description, etc. The only option for import is via SQL or CSV file.

View Replies !   View Related
Import Incomplete CSV File
full sequence should be:

name, surname, telephone, postcode

but the data I have in CSV is more like
name1, surname1, postcode1
name2, surname2, telephone2
surname3, telephone3, postcode3
etc.

so, in many rows the data pattern is incomplete.

Is there any way to solve this during INSERT? best thing would be to make mysql able to insert an empty field where information is missing, and the relevant one where available..

View Replies !   View Related
Import CSV From String, Not A File
does anyone know if it's possible to import "geek@geeksupport.com,test@example.com,abc@example.com" into a temporary table with 1 field into mysql? This will be coming from a webpage, not a file.

I know I can chop it in php and do an insert on each email address, but hoping if there's some kind of built-in mysql to do this.



View Replies !   View Related
Import Sql File Into PhpMyAdmin
I am trying to import SQL file which contains Structure & data into PhpMyAdmin locally and i get error message:

You have an error in your SQL syntax near 'ENGINE=MyISAM AUTO_INCREMENT=36 DEFAULT CHARSET=latin1' at line 14

The file size is about 1.95 MB. The file was exported through SQLyog as SQL Statements and the following fields were ticked:

-Include "USE dbname-" statement
-Include "DROP TABLE" STATEMENT
-Add "CREATE DATABASE"
-Lock All Tables For Read
-Create Bulk Insert Statements

The fields left unticked are:

-Flush Logs Before Dump
-Add Lock Around Insert Statements
-Set FOREIGN_KEY_CHECKS=0

Don't know much about MySQL, any help would be much appreciated.

View Replies !   View Related
Import 20GB Sql File
I am importing 20GB sql file to a MySQL database but receiving an error. I am executing the following command on dos prompt

Code:
mysql -uroot -p database_name < e:data.sql
The error I get

Code:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'data.sql
39,59562,4,0),(11183,59850,4,0),(41,39376,4,0),(39,59861,4,0),(41,4884' at line 1
I have exported data on CentOS using mysqldump.

I did not make any change to the file except uncompressing after download from the live server.

What can I do to resolve this issue?

Windows Server 2003 Enterprise Edition
MySQL Version: 5.0.51a-community-nt MySQL Community Edition (GPL)

View Replies !   View Related
Import Big .sql File Not Working ?
I am having trouble importing a large SQL file into MySQL.

I am pasting this into start run cmd:

cd M:MySQLMySQL Server 5.1in
mysql -h localhost -u root -p db_name < db_data.sql

and I get this message:
The system cannot find the file specified.

I have one disk drive that is partioned. The CMD window starts on the C drive but MySQL is installed on my M drive. I have tried changing drives by entering:
cd M:

but nothing happens it stays on the C drive.

View Replies !   View Related
Mysqldump: Got Error: 1033: Incorrect Information In File
mysqldump: Got error: 1033: Incorrect information in file: './database/aaggregate_mysql_1220926200.frm' when using LOCK TABLES.

I also tried dropping the table with error but it wont even drop A friend of mine told me the table didnt close and in phpmyadmin it tells me invalid eof errcode -1 or something of that nature. I also tried dumping the database through sqlyog but it wont let me do that either.

View Replies !   View Related
Mysqldump With Millions Of Rows (ibdata1 File Over 11GB)
New user successfully created database with millions of rows (ibdata1 file over 11GB). Backup takes for ever using mysqldump. Am I running utility wrong or is there another utility that runs in less than 18 hours....?

View Replies !   View Related
MySQL Import Text File Too Big?
Our production database in an exported textfil runs about 60 MB.
Compressed that's about 9 MB.

I'm trying to import the export into another machine running FC3 and
mySQL 11.18, and it appears as though the file may be too big!
When I try to do it via command line:

mysql -u root --host=localhost printing < ./printing.txt

It eventually errors out with a "syntax error on line X" and only about
half the tables get imported, and MyPHPAdmin GUI interface says it has
a 2MB file limit on importing.

This concerns me. If something were to happen to our production
database, how am I going to restore it?

I tried to do a search on mysql.com, but that's a less than helpful
site for support. A newsgroup search on the topic didn't come up with
much, so maybe I'm just bad at using keywords.

View Replies !   View Related
Data Import From Text File
When I try to import a text file with new data for an existing
table I get the error "1148 - the used command is not allowed
with this MySQL version."

I have tried with both PHPMyAdmin2.3 and with MySQLFront 2.5.
Both these GUI programmes have an "import from text file" command
which I have used successfully several times to add entries to
this table before - running just this MySQL version. I have
structured the data in the text file in just the same format as
previously.

Both these programmes are connecting to the database successfully
now and will display the contents of the existing table data and
strcutre of the database etc (despite an earlier connection
problem which seems to have been solved spontaneously).

But both now deliver exactly this error message (and therefore I
assume it is MySQL and not the interface programmes which is
doing it).I cannot see that I am doing anything different.

I have MySQL 4.0.12 on Windows ME PC with a local Apache server
and PHP.

View Replies !   View Related
Import Large Excel File
I have a large excel file, and some of the contents of it contain commas. I was wondering how I can import this information into mysql. I was thinking of using csv formant, but think the excess commas in the populated information will cause issues with this.

View Replies !   View Related
Mysql Import CSV File Problem
I use this query in a PHP script to import a csv file

$result = "
LOAD DATA INFILE '$uploadlocation' INTO TABLE $table2
FIELDS TERMINATED BY '$seperator'
ENCLOSED BY '"'
LINES TERMINATED BY '
'
";

It's been working fine for a long time until now alll of a sudden this error popped up:
Can't get stat of '/home/xxxx/public_html/data/xxxx.csv' (Errcode: 13)

The user has File_priv set to yes.
I even tried importing with the mysql root account but that didn't work either.
Using LOAD DATA LOCAL INFILE gives : 1148: The used command is not allowed with this MySQL version, so that's not an option

View Replies !   View Related
Import File Delmited By The | Character
I have a .txt file of about 200,000 lines that I need to import into a mysql database. Each line contains four records, but unfortunately they are seperated by the | character. I have tried importing it using the LOAD DATA command but it imports everthing into one field. I need to import into four fields.
how to tell mysql that the file is | delimited?

View Replies !   View Related
Csv File(s) Exists Import Into MySQL
I am hoping to write a solution that imports any csv files that exist in a given directory into mySQL. I know how to write a SQL command to import a single file, but am wondering the best method to automate importing whenever a file shows up in a given directory (and even better move them to another directory post-import).

Is there something like a trigger inside of mySQL that can help me do this? I can run a cron or the like to check for files, parse them, run the mySQL commands, move them, etc. but I am hoping for a much cleaner internal answer. Since it will eventually be hosted I may not have the capability to run scripts.

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved