0

I have xampp installed on linux mint and now i want to connect vs code to the sql-database.

I have installed the extension SQLTools and created a connection to the database with the correct credentials but then i get an error: Error opening connection connect ECONNREFUSED 127.0.0.1:3306.

The error is the same also when i try using other extensions like vscode-database or SQL Server (mssql).

I really would appreciate help to this.

2 Answers2

1

i now have added i now have added in the settings the socket path: "socketPath": "/opt/lampp/var/mysql/mysql.sock"` to my settings.json.

then i installed mysql-server and executed the following query in the mysql workbench: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypassword'

now i'm able to log in to the later added mysql server but still not to the mysql server in lampp. When i try to connect then i get the error `Error opening connection ER_BAD_DB_ERROR: Unknown database 'my_database'

I've also tried different ports like 80 or 8889 but that didn't help. Does someone have an idea what to do?

`

0

If you had restarted your computer, here is a fix that helped me out.

sudo service mysql start
Alkari
  • 116
  • 2
  • 11