mysql5.7.20 installation and configuration method graphic tutorial (mac)

mysql5.7.20 installation and configuration method graphic tutorial (mac)

MySQL 5.7.20 installation and configuration method graphic tutorial, share with you

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

It is strongly recommended to download the dmg file. After downloading the tar version and unzipping it, you need to move the folder to the default installation location /usr/local. It also requires various configurations, which is really troublesome~

2. Double-click the pkg file to install it, and continue until the following interface pops up:

The part in the red box in the figure is the initial password after MySQL installation, please remember

3. Open the system "Preferences" and click the MySQL icon below

Enter the mysql console, where you can start or stop the mysql server

4. Environment Setup

Open the terminal, enter the MySQL installation directory /usr/local/mysql, enter the bin directory, and execute the mysql -u root -p login statement. The system prompts the error "-bash:mysql:command not found". The reason is that when executing the command, the system will actively search for the command under the environment variable $PATH. If the command is not found, it will prompt that it does not exist. Because we did not configure MySQL after installing MySQL, the system cannot find the mysql command.

Edit the file, vim ~/.bash_profile and add the MYSQL_PATH environment variable:

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

Type source ~/.bash_profile to make the file take effect immediately.

5. Reset Password

Enter the bin file and enter the new password in the terminal. The password here is the password automatically generated by the system that you remembered before. Then use mysql -u root -p to log in to mysql.

6. Aliases

In order to improve work efficiency, it is obviously troublesome to enter mysql in the bin file every time. For this reason, we need to define an alias so that no matter where you are, you can directly call the mysql and mysqkadmin commands. Terminal input:

alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin

Wonderful topic sharing:

MySQL different versions installation tutorial

MySQL 5.6 installation tutorials for various versions

MySQL 5.7 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 WorkBench installation and configuration graphic tutorial
  • MySQL 5.7.17 and workbench installation and configuration graphic tutorial
  • mysql workbench installation and configuration tutorial under centOS
  • MySQL and MySQL Workbench Installation Tutorial under Ubuntu
  • Solution to the error "libpng12-0 package not installed" when installing mysql workbench in Ubuntu 16.10
  • MYSQL ZIP installation-free version configuration steps and graphical management tool mysql-workbench
  • MySQL 5.7.12 installation and configuration tutorial under Mac OS 10.11
  • MySQL 5.7.17 installation and configuration tutorial for Mac
  • MySQL 5.7.13 installation and configuration method graphic tutorial on Mac
  • MySQL5.7+ MySQL Workbench installation and configuration method graphic tutorial under MAC

<<:  Understanding Vuex in one article

>>:  Using vsftp to build an FTP server under Linux (with parameter description)

Recommend

Using iframe techniques to obtain visitor QQ implementation ideas and sample code

Today at work, a friend I added temporarily asked ...

Node quickly builds the backend implementation steps

1. First install node, express, express-generator...

Implementation code of jquery step progress axis plug-in

A jQuery plugin every day - step progress axis st...

CSS web page responsive layout to automatically adapt to PC/Pad/Phone devices

Preface There are many devices nowadays, includin...

Detailed explanation of three commonly used web effects in JavaScript

Table of contents 1 element offset series 1.1 Off...

Font Treasure House 50 exquisite free English font resources Part 1

Designers have their own font library, which allo...

Install centos7 virtual machine on win10

1. Download VMware Workstation 64 version https:/...

Example code for using @media in CSS3 to achieve web page adaptation

Nowadays, the screen resolution of computer monit...

Example of how to generate random numbers and concatenate strings in MySQL

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

Vue+Websocket simply implements the chat function

This article shares the specific code of Vue+Webs...

js code that associates the button with the enter key

Copy code The code is as follows: <html> &l...

How to implement call, apply and bind in native js

1. Implement call step: Set the function as a pro...

Detailed explanation of Vue custom instructions and their use

Table of contents 1. What is a directive? Some co...