Complete steps to install mysql5.7 on Mac (with pictures and text)

Complete steps to install mysql5.7 on Mac (with pictures and text)

I recently used a Mac system and was preparing to build a local web server environment. Because the Mac system comes with PHP and Apache, but not MySQL, you need to install MySQL manually. This time, the latest version of MySQL 5.7.17 is installed.

1. Download from the official website

MySQL v5.7 official version download address: https://www.jb51.net/softs/451120.html

Click the address above and you will see the page shown below. You may not know which one to download. I downloaded the last one, which is the button marked in red in the picture. Why? Because it is a dmg file, it is a fool-proof installation, and you just need to confirm along the way.

After clicking in, you will see two big buttons, Login and Register. If you don’t want to do these tedious steps, don’t worry, just look at the text in the red circle in the picture below and click on it to download it directly. (I didn’t know about this trap the first time, so I just registered obediently)

2. Install MySQL

After the download is complete, click Install, confirm all the way, and wait for the installation to be successful.

Start mysql

Go to System Preferences, find MySQL in the bottom row, click "Start MySQL Server" to start MySQL

Command line operation

Find iTerm in the application and open it. First run the following two commands:

alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin

These two commands are for the convenience of running MySQL commands by directly opening iTerm, instead of having to enter the MySQL installation directory to run them. Next, you need to reset your password

Reset password command:

mysqladmin -u root -p password newpass

newpass is your new password

After running the command to reset the password, the system prompts you to enter the old password. Students who have installed MySQL 5.6 or earlier versions know that when MySQL is run for the first time, a default password will be assigned to the root user: root. This old password is root. But now if you enter root, the system prompts that the password is wrong. What's going on?

It turns out that version 5.7 will no longer assign a default password to the root user, but will give a temporary password. If you are careful, a temporary password will pop up for you to save after the mysql installation is successful. If you haven't saved it, it doesn't matter. There will be a notification bar on the right, as shown in the picture:

My temporary password is _;kb8t7=-ZoU

Enter the temporary password, the password is changed successfully, and then log in with the new password:

mysql -u root -p

Press Enter, new password, press Enter, login successful!

Now you can write your sql commands!

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • MySQL installation diagram MySQL graphic installation tutorial (detailed instructions)
  • Installation and configuration of MySQL 5.6 under Windows with screenshots and detailed instructions
  • MySQL 5.6 (Win7 64-bit) download, installation and configuration graphic tutorial
  • MySQL 5.5 installation and configuration method graphic tutorial
  • CentOS 6.4 installation and configuration of LAMP server (Apache+PHP5+MySQL)
  • Install Apache and PHP under Linux; Apache+PHP+MySQL configuration strategy
  • Graphic tutorial for installing mysql-5.6.4 under Linux
  • Summary of solutions for the problem that MySQL 5 cannot be started after installation (cannot start service)
  • Graphical method for installing Apache+MySQL+PHP operating environment under Windows
  • Some problems you may encounter when installing MySQL

<<:  In-depth explanation of special permissions SUID, SGID and SBIT in Linux

>>:  Native js implementation of slider interval component

Recommend

Detailed explanation of the pitfalls of MySQL 8.0

I updated MySQL 8.0 today. The first problem: Nav...

Detailed explanation of how to use the vue3 Teleport instant movement function

The use of vue3 Teleport instant movement functio...

Detailed process of upgrading gcc (version 10.2.0) under CentOS7 environment

Table of contents Short Introduction 1. Check the...

Tips for creating two-dimensional arrays in JavaScript

Creation of a two-dimensional array in Js: First ...

CSS achieves highly adaptive full screen

When writing my own demo, I want to use display:f...

Installation and configuration of mysql 8.0.15 under Centos7

This article shares with you the installation and...

How to view the database installation path in MySQL

We can view the installation path of mysql throug...

How to solve the problem of case insensitivity in MySQL queries

question Recently, when I was completing a practi...

How to Learn Algorithmic Complexity with JavaScript

Table of contents Overview What is Big O notation...

Ubuntu16.04 builds php5.6 web server environment

Ubuntu 16.04 installs the PHP7.0 environment by d...

One line of code solves various IE compatibility issues (IE6-IE10)

x-ua-compatible is used to specify the model for ...

How much data can be stored in a MySQL table?

Programmers must deal with MySQL a lot, and it ca...