Teach you how to install mysql database on Mac

Teach you how to install mysql database on Mac

Download MySQL for Mac: https://downloads.mysql.com/archives/community/
Note: I downloaded the community version, the mysql version should be consistent with your MAC version. Of course, if you have installed other MYSQL versions before, be sure to uninstall them first.

Double-click mysql-8.0.0-dmr-osx10.11-x86_64.dmg to decompress and install.

Continue -> Continue, Agree -> Install. Write down the password in the pop-up window.

Enter system preferences, find mysql, and start the service

Add mysql commands to the system

(1) Enter /usr/local/mysql/bin and check whether there is mysql in this directory
(2). Execute vim ~/.bash_profile
Add the mysql/bin directory to this file
PATH=$PATH:/usr/local/mysql/bin
After adding, press esc and enter wq to save the changes.
(3). Finally, enter source ~/.bash_profile in the command line.

Log in to mysql through mysql -uroot -p and enter the password you saved previously

Reset the mysql initial password:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpassword');

You may also be interested in:
  • Solution to forgetting the MYSQL database password under MAC
  • Solution to the Chinese garbled code problem in Mac Mysql database
  • Sharing of methods of operating MySQL database with PHP under Mac environment
  • Graphic tutorial on installing MySQL database and configuring environment variables on Mac

<<:  A brief discussion on the binary family of JS

>>:  How to configure /var/log/messages in Ubuntu system log

Recommend

How to modify mysql to allow remote connections

Regarding the issue of MySQL remote connection, w...

CSS3 animation to achieve the effect of streamer button

In the process of learning CSS3, I found that man...

CSS clear float clear:both example code

Today I will talk to you about clearing floats. B...

MySQL 8.0.20 installation and configuration method graphic tutorial

MySQL download and installation (version 8.0.20) ...

A brief discussion on JS prototype and prototype chain

Table of contents 1. Prototype 2. Prototype point...

Basic installation process of mysql5.7.19 under winx64 (details)

1. Download https://dev.mysql.com/downloads/mysql...

Layui implements sample code for multi-condition query

I recently made a file system and found that ther...

Implementation of react loop data (list)

First, let's simulate the data coming from th...

How to configure nginx to limit the access frequency of the same IP

1. Add the following code to http{} in nginx.conf...

Share 13 excellent web wireframe design and production tools

When you start working on a project, it’s importa...

Summary of common commands for Linux user and group management

This article summarizes the common commands for L...

Implementation of form submission in html

Form submission code 1. Source code analysis <...

How to install PHP7 Redis extension on CentOS7

Introduction In the previous article, we installe...

mysql subquery and join table details

Table of contents 1. What is a subquery? 2. Self-...

A brief discussion on the perfect adaptation solution for Vue mobile terminal

Preface: Based on a recent medical mobile project...