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

Implementation of communication between Vue and Flask

Install axios and implement communication Here we...

Detailed explanation of Docker container network port configuration process

Exposing network ports In fact, there are two par...

Vue implements the full selection function

This article example shares the specific code of ...

Detailed tutorial on installing Python 3.6.6 from scratch on CentOS 7.5

ps: The environment is as the title Install possi...

12 types of component communications in Vue2

Table of contents 1. props 2..sync 3.v-model 4.re...

A detailed introduction to setting up Jenkins on Tencent Cloud Server

Table of contents 1. Connect to Tencent Cloud Ser...

Uniapp implements DingTalk scan code login sample code

Since Uniapp does not have DingTalk authorization...

JS implements random roll call system

Use JS to implement a random roll call system for...

Mysql master/slave database synchronization configuration and common errors

As the number of visits increases, for some time-...

Detailed explanation of Mencached cache configuration based on Nginx

Introduction Memcached is a distributed caching s...

Detailed tutorial of using stimulsoft.reports.js with vue-cli

vue-cli uses stimulsoft.reports.js (nanny-level t...

The difference between HTML iframe and frameset_PowerNode Java Academy

Introduction 1.<iframe> tag: iframe is an i...

CSS container background 10 color gradient Demo (linear-gradient())

grammar background: linear-gradient(direction,col...

How to separate static and dynamic state by combining Apache with Tomcat

Experimental environment Apache and Tomcat are bo...

Theory: The two years of user experience

<br />It has been no more than two years sin...