I have created a MySQL docker container with
sudo docker run -d --name db-mysql -e MYSQL_ROOT_PASSWORD=mypassword -e MYSQL_DATABASE=DB mysql
I have schema.sql to create the schema
DROP DATABASE IF EXISTS `DB`;
CREATE DATABASE `DB`;
USE `DB`;
DROP TABLE IF EXISTS `Occurrences`;
CREATE TABLE `Occurrences` (
`IdOccurrence` int NOT NULL AUTO_INCREMENT,
`Name` varchar(100) NOT NULL,
`Min_probability` double NOT NULL,
PRIMARY KEY (`IdOccurrence`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
INSERT INTO `Occurrences` VALUES (1,'Frequent',20),(2,'Probable',10),(5,'Possible',1),(6,'Rare',0.1),(7,'Remote',0);
And try to import it (in Ubuntu 18.04) with
sudo docker exec db-mysql mysql -uroot -pmypassword DB < schema.sql
However, I get this warning
mysql: [Warning] Using a password on the command line interface can be insecure.
But the database DB remains empty.
Where is my error?
-h 127.0.0.1-p 3306for host and port if they're different to default