🎓 Top 15 Udemy Courses (80-90% Discount): My Udemy Courses - Ramesh Fadatare — All my Udemy courses are real-time and project oriented courses.
▶️ Subscribe to My YouTube Channel (178K+ subscribers): Java Guides on YouTube
▶️ For AI, ChatGPT, Web, Tech, and Generative AI, subscribe to another channel: Ramesh Fadatare on YouTube
Introduction
Before you can start using MySQL, you need to set up the MySQL environment on your system. This chapter will guide you through installing MySQL on different operating systems, configuring the server, and connecting to the MySQL database.
Installing MySQL
Installing MySQL on Windows
- Download MySQL Installer:
- Visit the MySQL Downloads page.
- Choose the "MySQL Installer for Windows" and download the installer.
- Run the Installer:
- Open the downloaded installer file.
- Choose the setup type (Typical, Complete, or Custom). For most users, the "Developer Default" option is recommended.
- Follow the Installation Steps:
- Follow the prompts to install MySQL. This includes selecting the products to install, setting up the MySQL server, and configuring the MySQL Router (if needed).
- Configure MySQL Server:
- Set the root password for your MySQL server.
- Optionally, create additional user accounts.
- Choose the default server settings or customize them as needed.
- Complete Installation:
- Once the installation is complete, MySQL Workbench and MySQL Shell will be available to manage your MySQL server.
Installing MySQL on macOS
- Download MySQL DMG Archive:
- Visit the MySQL Downloads page.
- Choose "macOS" and download the DMG archive.
- Install MySQL:
- Open the downloaded DMG file and double-click the MySQL installer package.
- Follow the installation prompts.
- Configure MySQL:
- During the installation, set the root password.
- Choose whether to start MySQL automatically at system startup.
- Complete Installation:
- MySQL Workbench and MySQL Shell will be available to manage your MySQL server.
Installing MySQL on Linux
Using APT (Debian/Ubuntu)
- Update Package Index:
sudo apt update - Install MySQL Server:
sudo apt install mysql-server - Run MySQL Secure Installation:
sudo mysql_secure_installation- Follow the prompts to secure your MySQL installation, including setting the root password.
Using YUM (RHEL/CentOS)
- Add MySQL Repository:
sudo rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm - Install MySQL Server:
sudo yum install mysql-server - Start MySQL Service:
sudo systemctl start mysqld - Run MySQL Secure Installation:
sudo mysql_secure_installation- Follow the prompts to secure your MySQL installation, including setting the root password.
Connecting to MySQL
Using MySQL Workbench
- Open MySQL Workbench:
- Launch MySQL Workbench from your applications menu.
- Create a New Connection:
- Click on the "New Connection" button.
- Enter a name for your connection.
- Set the hostname to
localhost. - Set the username to
root(or another user if you've created one). - Click "Test Connection" to ensure everything is set up correctly.
- Connect to the Database:
- Click "OK" to save the connection.
- Double-click the new connection to connect to your MySQL server.
Using MySQL Command Line
- Open Command Line Interface:
- On Windows, open Command Prompt.
- On macOS/Linux, open Terminal.
- Connect to MySQL Server:
mysql -u root -p- Enter the root password when prompted.
- Verify Connection:
- Once connected, you will see the MySQL prompt:
mysql>. - You can now start executing SQL commands.
- Once connected, you will see the MySQL prompt:
Conclusion
Setting up the MySQL environment involves downloading and installing the MySQL server, configuring it, and connecting to the database using tools like MySQL Workbench or the command line. With your MySQL environment set up, you can start creating and managing databases.
My Top and Bestseller Udemy Courses. The sale is going on with a 70 - 80% discount. The discount coupon has been added to each course below:
Build REST APIs with Spring Boot 4, Spring Security 7, and JWT
[NEW] Learn Apache Maven with IntelliJ IDEA and Java 25
ChatGPT + Generative AI + Prompt Engineering for Beginners
Spring 7 and Spring Boot 4 for Beginners (Includes 8 Projects)
Available in Udemy for Business
Building Real-Time REST APIs with Spring Boot - Blog App
Available in Udemy for Business
Building Microservices with Spring Boot and Spring Cloud
Available in Udemy for Business
Java Full-Stack Developer Course with Spring Boot and React JS
Available in Udemy for Business
Build 5 Spring Boot Projects with Java: Line-by-Line Coding
Testing Spring Boot Application with JUnit and Mockito
Available in Udemy for Business
Spring Boot Thymeleaf Real-Time Web Application - Blog App
Available in Udemy for Business
Master Spring Data JPA with Hibernate
Available in Udemy for Business
Spring Boot + Apache Kafka Course - The Practical Guide
Available in Udemy for Business
Comments
Post a Comment
Leave Comment