How to import database without having .sql file? - mysql

I have removed Windows from my laptop and booted Ubuntu and want to import my databases from xampp. They are located on xampp folder but I don't have .sql files created for every table.

You still need to export your databases to sql files from windows which you can then import into Ubuntu. The structure and information schemas of those database files inside Data directory are stored in internal database and so copying and pasting the data folder might corrupt them and render them unusable. In windows you can use command line to dump the databases mysqldump -u username -p database > database.sql then import the database in Ubuntu.

The easiest way is to install xampp on your ubuntu (read this:
Install xampp on ubuntu 16.04
)
after that, move data folder from old xampp/mysql to new path.
now, you can use your xampp on ubuntu, or export and import your db by command line (How to Back Up MySQL Databases From The Command Line) or phpmyadmin to your mysql server

Related

Can i import a .sql file from wamp to xampp?

i have a .sql file that was exported from wamp, my friend only uses xampp. Is it possible to import my .sql file to xampp?
Yes because the .sql file is most likely independent of the server stack.
Of course it is possible, when wamp give you a export of .sql, this file can be used with all standard web server. (xampp)
I think this may help
Depending on the tool and parameters used to create the .sql dump file of multiple databases, the file will normally have
CREATE DATABASE DBn...;
and
USE DBn;
statements that will allow your import to proceed without hiccups. For example, both the mysqldump command mysqldump command and phpMyAdmin's Export function for multiple database insert them.
Assuming you have exported with a sensible tool like those above, then you can import the database with a command line like this:
mysql -u username -p < dumpfile.sql
Your mysql username account needs to have appropriate privileges to, for example, create databases.
You can even run this command in a more familiar way by naming the startingDB database to use before running the commands in dumpfile.sql:
mysql -u username -p startingDB < dumpfile.sql

I can't import a .sql backup in PhpMyAdmin because the file is too big, what can I do?

I am trying to upload a database backup into my local MySql database using PhpMyAdmin
When I try to import my .sql backup file it go into error and it say to me that maybe the file is too big (31 mb)
Reading the documentation it seems to me that I can change some configuration file to change the size value but I can't find this configuration file and this value
Someone can help me?
Tnx
Andrea
The phpMyAdmin manual has several alternative suggestions.
These include:
Using the $cfg['UploadDir'] feature to upload the file to the web server, which can help overcome upload or timeout limitations,
Using a third-party utility especially designed for this purpose, such as BigDump, or
Using the MySQL command line interface, when shell access is available.
You should import from command line, here you will not need to change configuration
Linux Shell
shell> mysqldump db_name < backup-file.sql
Windows CMD
mysql.exe -p -u[user] [database] < backup-file.sql
And for phpMyAdmin import file size Link

get the copy of database from mysql

Let's say I remote from my workbrench to the database which is on server now for some reason I need to have copy of the database on my another computer as a local database. How can I do that?
Export it to a single file (whatever.sql), then import it by running the script on your local computer.
There's a "Data Export" link on the left side if you connect to the remote server using MySQL Workbench. Click on that and go through the export process. Then connect to your local server, click on "Data Import/Restore", and choose the file you just saved.
First export data from database, then import database or specific table import in local server.
$ mysqldump -u [uname] -p[pass] [dbname] > [backupfile.sql]
To dump all MySQL databases on the system, use the --all-databases shortcut:
$ mysqldump -u root -p --all-databases > [backupfile.sql]
Source :How to Copy (Backup) a MySQL Database
In addition to a dump and restore you can try the MySQL Workbench migration module which allows to migrate from MySQL to MySQL (useful for instance to upgrade from a previous version or to copy a schema, as in your case).
MySQL Workbench migration (general description, video tutorial, white paper): http://www.mysql.com/products/workbench/migrate/
The MySQL Workbench migration wizard: http://dev.mysql.com/doc/workbench/en/wb-migration-wizard.html

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).

Import/Exporting databases from one machine to another

I have two PCs, one is Ubuntu 8.10 and the other Ubuntu 9.10. On the Ubuntu 8.10, i have a few databases in phpmyadmin which i would like to copy across to the Ubuntu 9.10 phpmyadmin(which has no databases).
I'm not sure if i'm on the right path but here's what i think i should do:
Export the databases onto Ubuntu 8.10. And copy those files(.sql) and paste them onto the Ubuntu 9.10 PC in a folder or something. Then import these .sql files into phpmyadmin on Ubuntu 9.10.
Is there a better way to do Copy the databases across?
Thanks.
From the main screen of phpMyAdmin (visible right after login) there are "Export" and "Import" links. Use these facilities to export your database (to a file on your computer) and then to import that file on the destination host.
Alternatively, if you have shell access to both machines, you could use the command mysqldump:
mysqldump --password=PASSWORD -u root DATABASE > INSERT_STATEMENTS
and then simply create all databases on the destination host with
mysql -u root --password=PASSWORD < INSERT_STATEMENTS
There's als MySQL Administrator that comes in the MySQL GUI Tools package. Since you've got access to both machines this is probably the easiest solution. Although I believe it just uses mysqldump, the GUI makes it a lot easier.