Install MySQL on Mac system
在下载安装包之前,看一下自己下载哪个版本:
uname -a
I downloaded it directly from the official website -> MySQL official website download URL
Because I downloaded it directly from the official website, this will be displayed when I run the installation package:
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;
Just keep clicking to continue:
The password I choose is the following:
set your own root password, be sure to remember it
Successful installation!
Find the MySQL logo in the system preferences.
It is said on the Internet that if it is not commonly used, it is best not to keep it on (silently turned off)
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
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
picture below means the connection is successful!
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!