Mac system installs MySQL to connect to Navicat (hands-on, super detailed)

Install MySQL on Mac system

在下载安装包之前,看一下自己下载哪个版本:
uname -a

insert image description here
I downloaded it directly from the official website -> MySQL official website download URL
insert image description here
insert image description here
Because I downloaded it directly from the official website, this will be displayed when I run the installation package:
insert image description here
Click the Apple logo in the upper left corner of the desktop, click Privacy and Security in System Preferences, and there is a general click Select the logo in the figure below to allow the installation package to run, and then it can be installed normally;
insert image description here

Just keep clicking to continue:
insert image description here

insert image description here
The password I choose is the following:
insert image description here
set your own root password, be sure to remember it

insert image description here
Successful installation!
insert image description here
Find the MySQL logo in the system preferences.
insert image description here
It is said on the Internet that if it is not commonly used, it is best not to keep it on (silently turned off)
insert image description here
and start configuring MySQL:

1.首先查看MySQL的安装目录:
ps -ef|grep mysql

2.更改配置文件
sudo vim ~/.bash_profile
进入文件后输入小写字母i进行编辑,插入下面路径后点esc然后:wq!进行保存。
export PATH=${
    
    PATH}:/usr/local/mysql/bin

3.使配置文件生效
source ~/.bash_profile

4.查看是否配置完成
mysql --version

5.使用root用户使用MySQL
mysql -uroot -p

insert image description here
So far, the installation of MySQL under the Mac system has been completed!

Navicat connects to local MySQL

Finally, use Navicat to connect to MySQL to achieve visualization.
PS: Be sure to enable MySQL first (mysql -uroot -p). If you don’t enable it, the connection will definitely fail. 【狗头】The
insert image description here
picture below means the connection is successful!
insert image description here
Generally speaking, it is relatively simple, and there are no special circumstances. I also refer to the articles of other bloggers for installation and operation. I wrote a tutorial and hope it can help everyone~ If the writing is not rigorous, welcome to correct and communicate!

Guess you like

Origin blog.csdn.net/weixin_45386694/article/details/128442779