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 build a deep learning environment running Python in Docker container

Check virtualization in Task Manager, if it is en...

Implementation of css transform page turning animation record

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

Implementation of mounting NFS shared directory in Docker container

Previously, https://www.jb51.net/article/205922.h...

Vue easily realizes watermark effect

Preface: Use watermark effect in vue project, you...

Classification of web page color properties

Classification of color properties Any color can ...

An article to understand Linux disks and disk partitions

Preface All hardware devices in the Linux system ...

WeChat applet selects the image control

This article example shares the specific code for...

Are you still Select *?

There are many reasons why an application is as s...

Detailed explanation of nginx configuration file interpretation

The nginx configuration file is mainly divided in...

Configuring MySQL and Squel Pro on Mac

In response to the popularity of nodejs, we have ...

Docker generates images through containers and submits DockerCommit in detail

Table of contents After creating a container loca...