Accidentally I exported all my mySQL databases to a single .sql file. I want to create those databases again in my development environment. When I try to import the file via PHPMyAdmin I get the following error message:
What should I do? Could you please help me?
If you look at the error, it says no Database selected.
You need to create an identical Database and import it from their.
You cannot just import a whole database, as it does not work.
Let me know if this solves,
Bryce
*also, make sure the files are speared by database, as this could make the error also, as the import can only import one in one file
Related
Im trying to import a pretty big .sql file with data grip. It's called file.sql and I need it in the schemas section. But it only allows me to upload it under a schema file. Will it still work?
Yes, it'll be fine.
Also, there're several ways to run "big" files:
Attach a file to project and execute Run
Run from Database Tool window via Run SQL Script or use mysql
Here is what I am dealing with, and I apologize for not being very sure of what I am doing.
I am trying to import a sql database dump file into xampp so that I can run a friends application.
I cloned the repository and put the code base into my htdocs folder. However, it needs to communicate with the database to run.
I have the dump file however when I go to import it I get the following:
Error
SQL query:
DROP TABLE IF EXISTS `sl_address`
MySQL said: Documentation
#1046 - No database selected
Do I need to create a database to dump into before I import the sql dump file? If so, does it matter what I name it, if it does how do I know what to name it?
I imagine if I don't name it correctly that the application won't be able to communicate with it.
I am really new to all this so I appreciate any help I can get. Thank you!
I think you need to create a database and select it before you run the SQL script that was generated by the dump.
Something like this:
create database newdb;
use newdb;
then the rest of your script.
Bobby
I'm new to magento.
I need to first install sample data. I created an empty database with phpmyadmin and then I imported magento_sample_data_for_1.9.1.sql file, but this throw me so many errors.
I'm following tutorials on youtube, I can't see this same error in any site, please if anyone know. Thank you so much.
error pic
EDIT FOR MORE INFO:
I'm trying to import magento sample data to a empty database (I read than I need to install it first, and then install magento), following tutorials, all steps are like this:
1) Download sample data done!
2) Create a new empty database. I'm doing it with phpmyadmin.
3) Import the sample data .sql and this should create all the tables from that file, but give me instead 124 errors.
I'm trying to install it on local, using WAMP.
I really need this because is for a job, I dont know because all the videos, all the tutorials are that exact steps to import the sample data to en empty database.
this is a tutorial reference: https://www.fastcomet.com/tutorials/magento/install-magento-sampledata
Anyone have similar issues? Any doubt of what I'm doing please let me know, and I tell you.
SOLUTION: Ok, the community is not that kindly. I've come with the solution.
phpmyadmin have some troubles reading .sql magento sample data so I used the SQL command line to import the .sql I needed, and it work that way.
Thank you, anyway! and if anyone pass though this problem, this is the solution.
First download fresh magento sample data from Download magento sample data
You can create new empty database in phpmyadmin and also follow below steps
Open your Xampp/Wamp php.ini file and edit below thing:
max_execution_time=18000
max_input_time=18000
post_max_size=1024M
upload_max_filesize=1024M
After all thing then save php.ini file and restart your Xampp/Wamp.
Now you can try to import sample data in phpmyadmin.
It's working fine....
I have had working knowledge on MySQL for years. And I used to export the schema and it's data as .sql file from my MySql database and import it where it's required. It worked for me.
But Recently I happened to replicate the data from a database which is in SQLServer and import it in my MySql database.
For this, I'm not able to generate .sql file for data but for Scripts(Schema) from SQLServer.
What is the process to make it happen? Since all SQL Server, MySQL, Oracle are all RDBMS Softwares which follows the standard. So what's the problem in it?
Its possible to do so.
Solutions 1: You can use phpmyadmin, it has export and import feature. It can be used directly, it copies data also. I have done that multiple times on a college project, worked great for me.
Solution 2: You may refer here for more: Export table data from one SQL Server to another
I have an old backup of some localhost databases (localhost.sql), which needs to be imported into PhPMyAdmin on a Windows 7 machine with XAMPP installed.
When I try to import localhost.sql (containing multiple databases) in PhPMyAdmin, I get the following error:
#1046 - No database selected
With a single database, you would simply create a new database with the same name and import to that. As this is an old backup, I am not able to recreate the export and I also donĀ“t know the database names that are inside localhost.sql.
Is there a way to recover this?
You have two possibilities to do this :
Create all the databases by hand in phpMyAdmin. Split your .sql file so that each file corresponds to a database. And finally you import each file in the correct database.
Edit your localhost.sql file and add the commands to create the databases ("CREATE DATABASE ...") in the right place. Then you import all at once.