- Install the necessary packages:
sudo pacman -S mysql mariadb-clients
- Configure MySQL:
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
- Start the MySQL service:
sudo systemctl start mysqld
- Run the MySQL security script:
sudo mysql_secure_installation
- Install the MySQL extension for Visual Studio Code:
Open VS Code, then type Ctrl + P
and type “ext install mysql
”.
- Connect to MySQL from VS Code:
Open the Command Palette (Ctrl + Shift + P
) and type “MySQL: Connect to MySQL
”. Enter your MySQL credentials and click “Connect
”.
- Access files from MySQL in VS Code:
Open the Command Palette (Ctrl + Shift + P
) and type “MySQL: Show Tables
”. This will open up a list of all the tables in your database. You can right click on a table to open it in a new tab and view the data.
Important
Taken from openAI playground