Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install mysql in mac

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "how to install mysql in mac", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "how to install mysql in mac" this article.

You can specify the version installation, not the default latest version

Brew install mysql@5.7

2 modify environment variables

Everything installed by brew is under the / usr/local/Cellar/ path, so you need to go inside and find mysql and then go in layer by layer until you find the bin directory. At this time, my computer is: / usr/local/Cellar/mysql@5.7/5.7.23/bin (maybe the mysql version is different and the path is different. Ok) 1) enter the command sudo vim .bash _ profile 2) at the bottom of the document, enter: export PATH=$PATH:/usr/local/Cellar/mysql@5.7/5.7.23/bin and then esc to exit the insert state, and enter: wq save exit at the bottom. 3) enter: source .bash _ profile enter and run the environment variable.

4. The other above practices require re-source .bash _ profile each time the terminal is turned on. So vi ~ / .zshrc, add: export PATH=$ {PATH}: / usr/local/Cellar/mysql@5.7/5.7.23/bin saved source ~ / .zshrc so that it can be done once and for all.

3 start the mysql service mysql.server start

Mysql download address https://dev.mysql.com/downloads/mysql/

After installation, the root user of mysql defaults to an empty password. First, set the password:

Mysql_secure_installation

After performing the previous step, you will see this message:

Would you like to setup VALIDATE PASSWORD plugin?

It means whether to install the password authentication plug-in, it is not recommended to install it, because you can only set a very complex password after installation, which is very troublesome. So enter no at this time and do not install it. If you accidentally choose y, never mind, you can connect to the mysql terminal and execute the command to uninstall the plug-in:

UNINSTALL PLUGIN validate_password

Uninstalled successfully! Now execute mysql_secure_installation again, choose not to load the password authentication plug-in, step by step down, you can set a simple password!

Now link the mysql terminal:

Mysql-u root-p

If you can connect successfully, it means it is installed!

The above is all the contents of the article "how to install mysql in mac". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report