I am trying to import contents of mysql table from a txt file.
I have already created dump of individual tables in .txt file. I then tried to import this txt file in my local server by LOAD DATA LOCAL INFILE. It worked fine locally. But when I tried to import using the same method in live. I am getting #1148 - The used command is not allowed with this MySQL version. I searched and followed steps from these two threads:
PHPMyAdmin saying: The used command is not allowed with this MySQL version
access denied for load data infile in MySQL
But it didn't work out. Now I am finding way to import these contents into the table from those txt files by ssh. Any help on how to do that from SSH will be great.
BTW, I am using mediatemple DV
TIA
Related
I am using the most recent version of PostgreSQL, and Pgadmin 4.
And I am attempting to import this database from git: https://github.com/pthom/northwind_psql
I attempted to load the sql file as a restore, and recieved this error:
This file is not intended for a pg_restore. You should to just execute it on psql.
pg_restore is a utility for restoring a PostgreSQL database from an archive created by pg_dump in one of the non-plain-text formats.
Take a look to create_db on GitHub shell script to understand how to import it.
I am trying to import a sample database "employees.sql" from official phpMyAdmin webpage. I am using uwamp server and getting the following error when using phpMyAdmin "import" option:
Unrecognized statement type. (near "source" at position 0)
.SQL FILE AT LINE WHERE ERROR IS REPORTED:
SELECT 'LOADING departments' as 'INFO';
source load_departments.dump ;
I am not sure what to change to successfully import the database. I also tried different things like putting load_departments.dump in quotes, but it still didn't work.
How do you use MySQL's source command to import large files in windows
must read and you will definitely get many ideas!
I think you should fire source command from cmd (command prompt)
I suggest you to create an empty database and import that sql file inside of it. Check it out..
Assumption: MySQL Server was installed and you have downloaded the employees database from github. Unzip the package and go to the directory from command prompt.
Enter the following command and on prompt, provide the sql password.
mysql -u root -p -t < employees.sql
Verify your installation by entering the following command.
mysql -u root -p -t < test_employees_md5.sql
When I am trying to import .DMP file via SQL developer I am getting this error
Exception: ORA-31640: unable to open dump file "/home/oracle/Desktop/dump/vahe.DMP" for read
dump directory and vahe.dmp file have read and write permission.
I use Database App Development VM.
how can I fix this issue ?
Thanks.
Well I found the problem. Actually I had type error. I have typo "vahe.DMP" instead of "vahe.dmp"(in lower case ). I think error message is not good one, because it should clearly say that file does not exist instead of saying "unable to open dump file '' for read" (IMHO)
Thanks everybody who tried to help me.
I was having the same error while importing DMP file shared from colleague.
error “ora-31640 unable to open dump file for read”
By creating new user with same name and password which was used while creating DMP file, and used this user for connect and importing, it resolved this error.
I was importing the data using "Data Pump Import Wizard" in oracle 11g R2 server.
I just started with sql using sqlite 3.7.17. I tried reading through here. As suggested I ran
create table test (id);
.quit
commands in sqlite terminal. No .db file was created in the current directory.
Then I tried to read through the documentation and ran
sqlite3 test.db
in the terminal. No .db file was created but sqlite terminal opened up. I ran
;
.quit
in the sqlite terminal and the .db file was created.
I am using Windows 7 and the terminal that I keep talking about is the Windows Powershell. I have placed the binaries for Windows in C:\Windows\system32\ folder so that the terminal recognizes sqlite3.
What did I do wrong? Why was .db file created once?
In the first case you probably ran sqlite3 without specifying a database file, so the program wouldn't know which file to create. In the second case you specified a file, but it isn't created before you're running an actual SQL statement against it (; is an empty SQL statement, but a statement nonetheless).
I am using the EnterpriseDB pgAdmin III (v. 1.12.1) on a Windows 7, 32-bit machine to work with PostgreSQL databases on a remote Linux server. I am logged in as the user postgres, which allows me to access the $PGDATA directory (in this instance, it is found here: /var/lib/pgsql/data/)
If I log into the server via a terminal, run psql, and use the \copy command to import data from csv files into newly created tables, I have no problems.
If I'm in pgAdmin, however, I use the COPY command to import data from csv files into newly created tables.
COPY table_name FROM '/var/lib/pgsql/data/file.csv'
WITH DELIMITER AS ',' csv header
Sometimes this works fine, other times I get a permissions error:
ERROR: could not open file '/var/lib/pgsql/data/file.csv" for reading: Permission denied
SQL state: 42501
It is the inconsistency of the error that is confusing to me. When the error arises, I change the file permission to anywhere from 644 - 777, with no effect. I also try moving the file to other folders, e.g., var/tmp/, also with no effect.
Any ideas?
The problem is the access permissions trough the directories to the file. Postgres user does not have access to your home folder, for example. The answer is to use a folder all users have access like /tmp, or create one with the correct permissions so any user can access/read/write there, a sort of users shared folder.
I think your postgres user still don't have access to your file.
Did you tried the folowing commands ?
chown postgres /var/lib/pgsql/data/file.csv
chmod u+r /var/lib/pgsql/data/file.csv
Try \COPY table_name FROM '/var/lib/pgsql/data/file.csv'
WITH DELIMITER AS ',' csv header
Notice the backslash before copy, when you run it with back slash it runs with user permissions other wise it just runs as postmaster which in the documentation is deprecated for recent versions of pg :|, anyways this might probably do the trick for ya .