step 1
- First, update your Linux system by running the command
sudo apt update. - After updating, install the MySQL server using
sudo apt install mysql-server. - This installs the main database system called MySQL. Once the installation is finished, start the MySQL server using
sudo systemctl start mysql. - To check whether MySQL is running properly, run
sudo systemctl status mysql. - If it shows active (running), it means the MySQL server is working correctly.
- You can also confirm it by opening the MySQL terminal with
sudo mysql. - If the terminal shows
mysql>, the database server is successfully installed.
step 2
Next, install MySQL Workbench, which is a graphical tool used to manage databases easily.
Go to your Downloads folder by running cd Downloads, then install the Workbench package using sudo dpkg -i mysql-workbench-community_8.0.46-1ubuntu24.04_amd64.deb.
If any dependency errors appear during installation, fix them using sudo apt --fix-broken install.
After the installation is completed, open MySQL Workbench by typing mysql-workbench in the terminal or by opening it from the Applications menu.
step 3
- When MySQL Workbench opens, create a new connection by entering the hostname
127.0.0.1, port3306, and usernameroot. - Then click Store in Keychain to save your password.
- After entering the password, click Test Connection to check if the connection is successful.
- If the test is successful, save the connection.
- Now you can start using MySQL Workbench to create databases, tables, and run SQL queries easily.
Commands
- - sudo apt update
- - sudo apt install mysql-server(Press Y if asked.)
- - sudo systemctl start mysql (you should see active (running))
- - sudo systemctl status mysql
- - sudo mysql (If it opens like:mysql>
- - then MySQL server is working. command-exit;
- - cd Downloads
- - sudo dpkg -i mysql-workbench-community_8.0.461ubuntu24.04_amd64.deb
- - Fix dependency if needed:sudo apt --fix-broken install
- - mysql-workbench
- - Create Connection
Top comments (0)