I am trying to build a basic CRUD web application using docker-lamp. I want to read Data from a CSV file, but when I run the docker-compose up -d command, I get this error: ERROR 13 (HY000) at line 22: Can’t get stat of ‘/docker-entrypoint-initdb.d/PERSON.csv’ (OS errno 2 – No such file or directory) in the mysql(version 8.0) log and the container stops.
This is the sql file:
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */
;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */
;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */
;
/*!40101 SET NAMES utf8mb4 */
;
--
-- Structure Table `PERSON`
--
CREATE TABLE `PERSON` (
`ID` INT,
`FIRSTNAME` VARCHAR(100),
`LASTNAME` VARCHAR(100),
PRIMARY KEY (`ID`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_520_ci;
LOAD DATA INFILE '/docker-entrypoint-initdb.d/PERSON.csv' INTO TABLE `PERSON` FIELDS TERMINATED BY ';' IGNORE 1 ROWS;
COMMIT;
In the docker-compose file I have for the service db the command:
--default-authentication-plugin=mysql_native_password --secure-file-priv=/docker-entrypoint-initdb.d
I tried to follow the already answered questions of this error, but I am not able to fix this error.
speakeasy_ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.