Saved location of Imported mysql all DB Dump - mysql

I am trying to Import AllDb dump from command line using the command:
mysql -u root -p < C:\alldb.sql
alldb.sql is the dump file I want to import in my local machine.
But I am unable to get where these dump file will be stored.

Open this file in text editor
There you will (hopefully) see database and table creation statements; (CREATE DATABASE ... CREATE TABLE ... or USE DatabaseName; CREATE TABLE... )
So, your dump will be stored in a new (or existing, depends on contents of your file) database.
for mysql data (i.e. raw db files): google://mysql windows data directory
(depends on your windows & mysql versions)

Related

can't import existing sql file to an empty database: db_name.table_name doesn't exist

I'm trying to import existing database file into an empty SQL database with the following command:
mysql -u username -p'password' db_name < dbfile.sql
but I get following Error:
ERROR 1146 (42S02) at line 1: Table 'db_name.oc_address' doesn't exist
I know that oc_address is a table name inside the SQL file, but I don't know what to do to import it correctly, I searched the web and also stack-overflow, found nothing on this error.
Download the actual opencart zip file
https://www.opencart.com/index.php?route=cms/download/download&download_id=62
Unzip it
open folder
\upload\install
and
run opencart.sql
if you have installed extensions that have need their own sql, you have to run their sql as well
After that run you backup file
To export an entire database and then load it into another server, your best bet is to use the mysqldump command line utility. Its export files contain the data definition language (tables, views, all that) for the database as well as the data.
You can also get it to export just the definitions.
mysqldump --no-data -u username -p'password' db_name > opencartddl.sql
Then you can import that file first, then your data file.
Or, you may be able to stand up a new, empty, Opencart instance and use its UI to import your data.
It's probably wise to avoid trying to write replacement DDL yourself if you can get a tool like mysqldump to do it.

Import MySQL XML Dump?

I have dumped a MySQL database (all tables) for use with PHPUnit using this command:
mysqldump --xml -t -u [username] --password=[password] [database] > /path/to/file.xml
I need to modify the test data, so I need to re-import it back into the database so I can work on it with MySQL workbench.
What is the command to reimport it back into a specified database?
And no, it's not as simple as LOAD XML, that works on a table by table basis, but this export has all tables in it.
NO, there is no built in way present to restore a XML formatted dump file. You can check this blog Restoring XML-formatted MySQL dumps for information on this as well as this existing post How to restore a mysql xml database file from mysql command line?

import MySQL database dump from .txt file

I have a Joomla database that was dumped into a .txt file on an appache server using the command:-
mysqldump -u admin --opt -p passwd > private/alexthekiddb.txt
How do import that into a new MySQL database on my IIS server so I can attempt a conversion from Joomla to Wordpress.
I can use phpmyadmin or the MySQL builtin command line tool.
I already have a 2nd new database created with the same name and user (and PW) as the original.
Normally, just running mysql private/alexthekiddb.txt or mysql < private/alexthekiddb.txt should be enough. Hence, such dump files are usually suffixed .sql
Of course, you should have a MySQL server on the target machine (IIS thing).

how import a mysqldump file locally

I want to import an sqldump file in my database "dbname" into the table "data" without using the network interface.
when i import the file via
mysql dbname -u databaseuser -pdatabasepass<data.sql
this is really slow on my ubuntu 12.04
but when i use this instead:
mysqlimport -u databaseuser -pdatabasepass --local data.sql
it is as fast as normal.
i think, because on my mashine it is parsing each line separately when using "mysql" and "<"
is there a way to use the mysqlimport syntax for importing an sql-file with CREATE and DROP TABLE stuff?
maybe just split the upper part in the sql-dump (with the drop table and create table statement) automatically and then only send the rest of the file with the INPUT-statements to mysqlinsert, that should work
There is no way to do that directly. What you need to do is run mysqldump --tab instead of the normal mysqldump, that will create both a .sql files containing table definitions and a CSV file containing data that can be imported with mysqlimport.
You can specify the path to a UNIX socket file with --socket=/path/to/... (or -S), which may be faster. You can find the socket path in the server's my.cnf. So, for example (and I'm just making up the path, here);
mysql dbname -u databaseuser -pdatabasepass -S /var/run/mysqld/mysqld.sock < data.sql
You can use this script: How do I split the output from mysqldump into smaller files?
and modify it, so you have only the create-statements in one file and the data statements in another.

Load huge sql dump to mySql

I have a huge mysql dump file generated from phpmyAdmin (150 000 lines of create table, inserts....)
The mySql query tool fails to open such a big file.
As a result i can't insert all the records.
Is there a way to do this ?
Thanks
John
The solution to restore large mysql database from sql dump file is using unix/linux shell command.
To restore mysql database from a dump file, just type the command below:
mysql -u #username# -p #database# < #dump_file#
Of course you need to replace #username# to your database username and #database# to your target database. and rename #dump_file# to your dump file file name (Ex: dump.sql) Once you enter the command, the linux/unix shell will prompt you for your database user password, just key in your database password and you are done
borrowed from: http://www.techiecorner.com/31/how-to-restore-mysql-database-from-sql-dump-file/
Split the file by parts. First the CREATE instructions, then the inserts.