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

A brief discussion on Python's function knowledge

Table of contents Two major categories of functio...

CSS mimics remote control buttons

Note: This demo is tested in the mini program env...

Take you to a thorough understanding of the prototype object in JavaScript

Table of contents 1. What is a prototype? 1.1 Fun...

HTML table tag tutorial (31): cell width and height attributes WIDTH, HEIGHT

By default, the width and height of the cell are ...

3 functions of toString method in js

Table of contents 1. Three functions of toString ...

Will CSS3 really replace SCSS?

When it comes to styling our web pages, we have t...

Implementation of dynamic rem for mobile layout

Dynamic rem 1. First, let’s introduce the current...

Docker large-scale project containerization transformation

Virtualization and containerization are two inevi...

Methods and techniques for quickly displaying web page images

1. Use .gifs rather than .jpgs. GIFs are smaller ...

A complete example of implementing a timed crawler with Nodejs

Table of contents Cause of the incident Use Node ...

How to use ss command instead of netstat in Linux operation and maintenance

Preface When operating and managing Linux servers...

Summarize how to optimize Nginx performance under high concurrency

Table of contents Features Advantages Installatio...

Linux command line quick tips: How to locate a file

We all have files stored on our computers -- dire...

The use of anchor points in HTML_PowerNode Java Academy

Now let's summarize several situations of con...