MySQL 8.0.11 MacOS 10.13 installation and configuration method graphic tutorial

MySQL 8.0.11 MacOS 10.13 installation and configuration method graphic tutorial

The process of installing MySQL database and configuring environment variables on Mac is recorded for your reference. The specific contents are as follows

Install mysql. Download mysql. I downloaded: mysql-8.0.11-macos10.13-x86_64.dmg

Double-click to open mysql-8.0.11-macos10.13-x86_64.dmg, and then double-click mysql-8.0.11-macos10.13-x86_64.pkg

Just click on Continue, it's a fool-proof installation, nothing to say

Select "Use Legacy Password Encryption" here, otherwise when you use Navicat to connect to MySQL, you will get an error that the authentication cannot be loaded.

Set a password for the "root" user

Installation Complete

After successful installation, using the mysql command returns the error: command not found, because the environment variables have not been configured.

Configuring environment variables

First, you need to know what kind of Shell you are using on Mac OS X.

Open the terminal and enter: echo $SHELL Press Enter to execute

If the output is: csh or tcsh, then you are using C Shell.

If the output reads: bash, sh, zsh, then you are probably using a variant of the Bourne Shell.

The default shell for Mac OS X prior to 10.2 was C Shell.

The default shell for Mac OS X 10.3 and later is Bourne Shell.

Mine is bash:

Input: cd /usr/local/mysql, press Enter to execute

Then enter: sudo vim .bash_profile, press Enter to execute

You need to enter the root user password. Sudo is used by the root user to modify the environment variable file.

After entering the editor, we first press "i" to switch to the "insert" state. You can edit the content by moving the cursor up, down, left, or right, or by pressing space, backspace, and enter, just like in WINDOWS.

At the bottom of the document, enter: export PATH=${PATH}:/usr/local/mysql/bin

Then press Esc to exit the insert state, and enter :wq at the bottom to save and exit (or directly press shift+zz, or switch to uppercase mode and press ZZ to save and exit).

Input: source .bash_profile and press Enter to execute and run the environment variables.

Then enter the mysql command to use it.

If you cannot connect to MySQL using Navicat,

It probably means that the authentication plugin "caching_sha2_password" cannot be loaded

solve

  • Open System Preferences, find MySQL, and click Initialize Database.
  • Enter your new password.
  • Select 'Use legacy password'.
  • Restart the mysql service.
  • Navicat links can now be used

After testing, I found that the above method requires re-source .bash_profile every time the terminal is closed and reopened.

PS: The following test is still invalid and has not been resolved yet

Some articles say vi ~/.zshrc, add it here:

export PATH=${PATH}:/usr/local/mysql/bin

After saving, source ~/.zshrc and you can do it once and for all.

Some articles mention modifying ~/.bashrc. If the system is zsh, modifying bashrc is invalid.

Wonderful topic sharing:

MySQL different versions installation tutorial

MySQL 5.7 installation tutorials for various versions

MySQL 5.6 installation tutorials for various versions

mysql8.0 installation tutorials for various versions

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 8.0.11 installation summary tutorial diagram
  • Detailed installation tutorial of mysql-8.0.11-winx64.zip
  • mysql8.0.11 winx64 installation and configuration method graphic tutorial (win10)
  • MySQL Community Server 8.0.11 installation and configuration method graphic tutorial
  • MySQL 8.0.11 Community Green Edition Installation Steps Diagram for Windows
  • MySQL 8.0.11 compressed version installation and configuration method graphic tutorial
  • MySql 8.0.11 installation and configuration tutorial
  • Detailed tutorial for installing MySQL 8.0.11 compressed version under win10
  • MySQL 8.0.11 MSI version installation and configuration graphic tutorial
  • MySQL 8.0.11 Installation Guide for Mac

<<:  Detailed explanation of the process of modifying Nginx files in centos7 docker

>>:  A brief introduction to React

Recommend

Comprehensive summary of mysql functions

Table of contents 1. Commonly used string functio...

Detailed explanation of how to restore database data through MySQL binary log

Website administrators often accidentally delete ...

If I change a property randomly in Vue data, will the view be updated?

Interviewer: Have you read the source code of Vue...

MySQL stored procedure method example of returning multiple values

This article uses an example to describe how to r...

Get / delete method to pass array parameters in Vue

When the front-end and back-end interact, sometim...

Implementation of css transform page turning animation record

Page turning problem scenario B and C are on the ...

Introduction to the role of HTML doctype

Document mode has the following two functions: 1. ...

52 SQL statements to teach you performance optimization

1. To optimize the query, try to avoid full table...

How to implement scheduled backup of CentOS MySQL database

The following script is used for scheduled backup...

Solution for Vue routing this.route.push jump page not refreshing

Vue routing this.route.push jump page does not re...

How to import txt into mysql in Linux

Preface When I was writing a small project yester...

Detailed explanation of the use of Vue.js render function

Vue recommends using templates to create your HTM...

N ways to align the last row of lists in CSS flex layout to the left (summary)

I would like to quote an article by Zhang Xinxu a...

Mobile browser Viewport parameters (web front-end design)

Mobile browsers place web pages in a virtual "...

How to use cookies to remember passwords for 7 days on the vue login page

Problem Description In the login page of the proj...