Skip to content

Commit

Permalink
corrección conexión mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
asafJortilles committed Jan 23, 2024
1 parent 5b5d249 commit a65388f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
18 changes: 12 additions & 6 deletions eda/eda_api/lib/services/connection/db-systems/mysql-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export class MysqlConnection extends AbstractConnection {
port: this.config.port,
database: this.config.database,
user: this.config.user,
password: this.config.password
password: this.config.password,
};

if (this.config.ssl != '0') {
this.config.ssl= { rejectUnauthorized: false };
if (this.config.ssl === '1') {
mySqlConn.ssl= { rejectUnauthorized: false };
}

return createConnection(mySqlConn);
Expand All @@ -68,9 +68,15 @@ export class MysqlConnection extends AbstractConnection {
async tryConnection(): Promise<any> {
try {
return new Promise((resolve, reject) => {
const mySqlConn ={ "host": this.config.host, "port": this.config.port, "database": this.config.database, "user": this.config.user, "password": this.config.password };
if (this.config.ssl != '0') {
this.config.ssl= { rejectUnauthorized: false };
let mySqlConn = {}
console.log(this.config)
console.log(this.config.ssl)
if (this.config.ssl === "1") {
console.log("1")
mySqlConn ={ "host": this.config.host, "port": this.config.port, "database": this.config.database, "user": this.config.user, "password": this.config.password, "ssl": { rejectUnauthorized: false }};
} else {
console.log("2")
mySqlConn ={ "host": this.config.host, "port": this.config.port, "database": this.config.database, "user": this.config.user, "password": this.config.password };
}
this.client = createConnection(mySqlConn);
console.log('\x1b[32m%s\x1b[0m', 'Connecting to MySQL database...\n');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export class DsConfigWrapperComponent implements OnInit {
this.alertService.addError('Formulario incorrecto, revise los campos');
}
else if (this.form.value.type.value !== 'bigquery') {
console.log(this);
this.addDataSource();
}
else {
Expand Down

0 comments on commit a65388f

Please sign in to comment.