Failed to open file, Error 2 - MySQL Import - mysql

I'm trying to import a MySQL Database via command line (Terminal). The file's path seems to be correct, but I keep getting an error message that is most likely showing that, the path of the SQL file I'm importing is not correct. Below is the sample of the command line I'm using and the error I'm getting...
NOTE: Linux Server, Centos 7 - MariaDB
source C:/Users/localcomputerUser/SQLFileFolder/SQLFile.sql
source C:/Users/localcomputerUser/SQLFileFolder/SQLFile.sql
Failed to open file 'C:/Users/localcomputerUser/SQLFileFolder/SQLFile.sql
', error: 2
Thanks for your support.

Related

How do I resolve a backup restoration error

I am trying to reconstruct a website from backups. When I try to import the database content via PHPMyAdmin, I get the following error:
Fatal error: Uncaught TypeError: mb_strcut() expects parameter 1 to be string, bool given in /home/customer/public_html/phpmyadmin/libraries/classes/File.php:772 Stack trace: #0 /home/customer/public_html/phpmyadmin/libraries/classes/File.php(772): mb_strcut(false, 0, 32768) #1 /home/customer/public_html/phpmyadmin/libraries/classes/Import.php(432): PhpMyAdmin\File->read(32768) #2 /home/customer/public_html/phpmyadmin/libraries/classes/Plugins/Import/ImportSql.php(135): PhpMyAdmin\Import->getNextChunk(Object(PhpMyAdmin\File)) #3 /home/customer/public_html/phpmyadmin/libraries/classes/Controllers/ImportController.php(635): PhpMyAdmin\Plugins\Import\ImportSql->doImport(Object(PhpMyAdmin\File), Array) #4 /home/customer/public_html/phpmyadmin/libraries/classes/Routing.php(186): PhpMyAdmin\Controllers\ImportController->index(Array) #5 /home/customer/public_html/phpmyadmin/index.php(18): PhpMyAdmin\Routing::callControllerForRoute('/import', Object(FastRoute\Dispatcher\GroupCountBased), Object(Symfony\Component\DependencyInjecti in /home/customer/public_html/phpmyadmin/libraries/classes/File.php on line 772
I have looked everywhere to try and find how to overcome the problem, but so far, no joy.
Any help more than welcome.
We have tried importing on to two different hosting platforms (Plesk and Siteground's own).
Plesk produced an "unknown" Plesk version error.
Also tried importing a dump and importing directly via PHPMyAdmin. Dump did not recognise the file, PHPMyAdmin produced this error. We also tried to restore the back up without any luck. Finally, we tried to open the mySQL zip file directly but it is password protected.
Note we have no control of the file source, which is the only back up.
Note 2. I get the same import error when I try to import to Xampp local server

Can't import file on Neo4j with RuntimeException error

I have updated the neo4j.conf file but can't seem to get rid of this error after changing the file and restarting. I am just trying to load a json file through neo4j and have included the line apoc.import.file.enabled=true on the neo4j.conf but doesn't seem to be working for me, I'm still getting the error message:
Failed to invoke procedure 'apoc.load.json' Caused by
java.lang.RuntimeException : Import from files not enabled, please set
apoc.import.file.enabled=true in your neo4j.conf
I am using neo4jCE 3.2.3 and have used the right file path for the json file as it previously worked on my desktop computer (I'm just trying to replicate it on my laptop) and I am using apoc 3.2.0.4 version plugin. The procedure apoc.load.json is also there when I call all procedures directory.

Neo.ClientError.Statement.ExternalResourceFailed on ubuntu

I'm trying to import a csv file in NEO4j db using script :
LOAD CSV FROM "file:///dataframe6.txt" AS line
RETURN count(*)
But I get following error:
Neo.ClientError.Statement.ExternalResourceFailed
Couldn't load the external resource at: file:/home/gaurav/sharing/dataframe6.txt
P.S. : I'm using ubuntu machine
added this line dbms.directories.import=/home/gaurav/sharing/
and dbms.security.allow_csv_import_from_file_urls=true
I had to change folder permission for user NEO4j, it works now

What does "IOException reading test.csv" error mean while reading external CSV from H2?

I'm trying to import some extra data to my existing H2 database. The extra data are in a .CSV file and I'm using the simple example SQL statement from H2 tutorial documentation:
SELECT * FROM CSVREAD('test.csv');
So far, I can only get the following exception:
Error: IO Exception: "IOException reading test.csv"; SQL statement:
SELECT * FROM CSVREAD('test.csv') [90028-176]
SQLState: 90028
ErrorCode: 90028
I am using SQuirreL client in Windows 7 to manage a local H2 database and so far, everything is working well. The test.csv is in the same directory as the database file.
Looks like a problem with the test.csv file. Is this on Linux ? Then check for case-sensitive file name and access permissions for the running process.
Could you read the file with FileInputStream from your code ? Is this a remote H2 db ?
In any case, it is the H2 server that needs access to the file. Probably the file is not in the CWD of the H2 process. Try to specify an absolute file name for the H2 server like /my/folder/test.csv or c:\my\folder\test.csv.

Error code 13 - on import of sqldump

Am getting following "permissions" error when trying to import an sqldump
Error Code: 1 - Can't create/write to file
'C:\ProgramData\MySQL\MySQL Server 5.5\Data\dealcrm\accessorieslink.MYI'
(Errcode: 13)
I have renamed the data folder and put it back recently.
Have tried giving full control for user "system" on the data folder - this is user
the mysql service is started with
any help welcome
EDIT**
Have also tried adding a folder C:/ProgramData/MySQL/MySQL Server 5.5/Temp/
and added this line to mysql.ini
tmpdir="C:/ProgramData/MySQL/MySQL Server 5.5/Temp/"
after import there are some files in the folder but still get error 13
As per documentation of the error code, in your particular situation, i.e. on Windows, you're most likely lacking a setting of the right temp directory where MySQL can dump tempfiles. Set it as described in the link above and you should be fine.