MySQL installation and configuration tutorial for Mac

MySQL installation and configuration tutorial for Mac

This article shares the MySQL installation tutorial on Mac for your reference. The specific content is as follows

First you need to download

MySQL Community Server download address: https://dev.mysql.com/downloads/mysql/

Go to the MySQL download page (https://dev.mysql.com/downloads/mysql/). If you are using Mac OS, the Mac OS X platform will be selected by default. The following are all MySQL versions that can be used on Mac OS. If you are using other platforms, just select it from the drop-down list of the "Select Platform" option.

There are many versions of MySQL on Mac OS, some of which are based on platforms, such as 10.5/10.6, and some are 32-bit and 64-bit. You can choose according to your system. The file suffixes are .tar.gz and .dmg. Here I chose .dmg. Click download on the right to download.

Then you will be redirected to another interface, which will ask you whether you need to register or not. Just select "No thanks, just take me to downloads!" at the bottom. Then you will be redirected to the download interface, which lists many servers for downloading. Just select one and start downloading.

Double-click the pkg file to install all the way down. Remember to save the password in the last pop-up box (it is the password of your mysql root account)


MYSQL2.pngUnder normal circumstances, the installation is successful.

At this point, the installation is successful, but additional configuration is required:

(1) Enter System Preferences


(2) Click mysql


(3) Start the MySQL service


At this time, if we enter the mysql -u root -p command in the command line, it will prompt that there is no commod not found. We also need to add mysql to the system environment variables.

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



Now you can log in to mysql through mysql -u root -p, and you will be asked to enter the password, which is the >fj on pic3...
After successful login, you can change the password by the following command

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

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:
  • Solution to forgetting the MYSQL database password under MAC
  • Download MySQL 5.7 and detailed installation diagram for MySql on Mac
  • Detailed graphic and text instructions for installing MySQL 5.7.20 on Mac OS
  • Solution to forget password when installing MySQL on Linux/Mac
  • Detailed steps to configure Apache + PHP + MySQL operating environment in Mac OS X
  • What to do if you forget the initial password when installing MySQL on Mac
  • How to modify the forgotten password when installing MySQL on Mac
  • Detailed steps to install mysql5.7.18 on Mac
  • Detailed installation and configuration of MySql on Mac
  • Tutorial on compiling and installing MySQL 5.7.17 from source code on Mac
  • Solution to forgetting mysql password in MAC
  • Configuring MySQL and Squel Pro on Mac

<<:  WeChat applet custom tabbar component

>>:  How to use Dockerfile to build images in Docker

Recommend

Mobile front-end adaptation solution (summary)

I searched online and found that many interviews ...

calc() to achieve full screen background fixed width content

Over the past few years, there has been a trend i...

URL representation in HTML web pages

In HTML, common URLs are represented in a variety ...

Exploring the Linux Kernel: The Secrets of Kconfig

Get a deep understanding of how the Linux configu...

Ubuntu Basic Tutorial: apt-get Command

Preface The apt-get command is a package manageme...

Tomcat8 uses cronolog to split Catalina.Out logs

background If the catalina.out log file generated...

CocosCreator Getting Started Tutorial: Making Your First Game with TS

Table of contents premise TypeScript vs JavaScrip...

Detailed explanation of docker compose usage

Table of contents Docker Compose usage scenarios ...

Detailed explanation of Mysql communication protocol

1.Mysql connection method To understand the MySQL...

MySQL 5.7.17 installation graphic tutorial (windows)

I recently started learning database, and I feel ...

A brief discussion on the use and analysis of nofollow tags

Controversy over nofollow There was a dispute bet...

An example of the calculation function calc in CSS in website layout

calc is a function in CSS that is used to calcula...

Implementation of whack-a-mole game in JavaScript

This article shares the specific code for JavaScr...

MySQL independent index and joint index selection

There is often a lack of understanding of multi-c...