0
Follow the code of my comic book from Heidisql:
CREATE DATABASE ProdPacote;
USE ProdPacote;
CREATE TABLE Produto(
ID_Produto INT PRIMARY KEY AUTO_INCREMENT,
Nome VARCHAR (200) NOT NULL,
Descricao VARCHAR (200) NOT NULL,
Preco DOUBLE NOT NULL);
CREATE TABLE Pacote(
ID_Pacote INT PRIMARY KEY AUTO_INCREMENT,
Nome VARCHAR (200) NOT NULL,
ID_Produto VARCHAR (200) NOT NULL,
Quantidade INT NOT NULL,
Data_entrada DATE NOT NULL,
Data_saida DATE NOT NULL);
CREATE TABLE Produto_Pacote(
ID_Produto_Pacote INT PRIMARY KEY AUTO_INCREMENT,
Data_Hora DATE NOT NULL,
FK_ID_Produto INT NOT NULL,
FK_ID_Pacote INT NOT NULL,
CONSTRAINT Produto_Pacote
FOREIGN KEY (FK_ID_Produto)
REFERENCES Produto (ID_Produto),
CONSTRAINT Pacote_Produto
FOREIGN KEY(FK_ID_Pacote)
REFERENCES Pacote(ID_Pacote));
That particular mistake won’t let me continue:
ERROR MESSAGE: Authentication to host 'localhost' for user 'root' method using 'mysql_native_password' failed with message: Access denied for user "root" @"localhost" (using password: YES)
The message is of login failure... you are sure that you are using the credentials and pointing to the correct host?
– Leandro Angelo
Thanks, I managed to fix the Login error, but now when I finish connecting to the database, the following appears Error: Failed to open a Connection to the database "Cannot obtain Provider Factory for data Provider named 'Mysql.Data.Mysqlclient'. " Check the conection and Try Again. Follow image above in the post.
– Henrique