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

How to use Linux commands in IDEA

Compared with Windows system, Linux system provid...

Mysql8.0 uses window functions to solve sorting problems

Introduction to MySQL Window Functions MySQL has ...

Solution to uninstalling Python and yum in CentOs system

Background of the accident: A few days ago, due t...

Detailed explanation of Vue component reuse and expansion

Table of contents Overview Is the extension neces...

Implementation of Vue counter

Table of contents 1. Implementation of counter 2....

How to set Tomcat as an automatically started service? The quickest way

Set Tomcat to automatically start the service: I ...

How to achieve 3D dynamic text effect with three.js

Preface Hello everyone, this is the CSS wizard - ...

How to set up a deployment project under Linux system

1. Modify the firewall settings and open the corr...

Solution for mobile browsers not supporting position: fix

The specific method is as follows: CSS Code Copy ...

Two ways to declare private variables in JavaScript

Preface JavaScript is not like other languages ​​...

About the problem of dynamic splicing src image address of img in Vue

Let's take a look at the dynamic splicing of ...

Detailed installation and use of SSH in Ubuntu environment

SSH stands for Secure Shell, which is a secure tr...