MacOS installation and configuration mysql specific steps

        MySQL is an open source relational database management system (RDBMS) widely used to build web applications and manage large data sets. It uses SQL (Structured Query Language) as the main language for managing data, which is popular for its ease of use, reliability, and scalability. MySQL was developed by Oracle Corporation and is available for various operating systems including Windows, Linux, macOS, and Unix. It is often used in conjunction with other web technologies such as PHP, Python, and Ruby on Rails.

I used to use the Windows system, but now I use the macOS system. The installation of mysql is somewhat different between the two.

The following are the specific steps for installing and configuring mysql on the macOS system.

1. Enter mysql to the official website, MySQL :: Download MySQL Community Server

Select the macOS system as shown in the figure

2. Select the version, I chose 8.0.25, x86 version

 ​

3. Click download, and you will be redirected to the following interface, where you are required to log in or register a mysql account. If you find it troublesome, you can directly select No thanks, just start my download. The software will be downloaded.

4. After the download is successful, click to open, and then double-click the installation package, a dialog box will pop up, choose to continue. 

5. A dialog box pops up, just enter the password, and then press Install Software. (computer screen password)

6. Then the following encryption interface pops up, just choose one of them. I choose the first strong encryption, press continue and the password setting interface will pop up.

7. Press Finish, and then wait for the installation, there will be a successful installation interface, during which a password confirmation box will pop up, just enter it. (computer screen password) 

 

8. Open the computer's system preferences, you can see the mysql logo, double-click to open, you can view the installed version. Green means the installation is successful and has been run on the computer.

 

9. The next step is to add environment variables, open the terminal on the startup platform, and enter ls -al to see if there is a .bash _profile file.

10. If not, we need to use touch .bash_profile to create a new file, and then check it and it will be displayed.

 

11. Next, use open .bash_profile to open the file, and a text will pop up.

 

12. Use the ps -ef|gref mysql command to find the file storage path of mysql, and enter export PATH=${PATH}:path/bin in the opened text

Note here: export must be in lowercase, and /bin must be added after the path

 

 12. If there is an error in the previous step, inputting source .bash_profile will display an error, which needs to be reopened and changed. Enter the source statement again to make the configuration statement take effect. Next, the terminal can use mysql statements, such as user login (during installation, the configured mysql password, the input password is not visible).

 

13. The above configuration is a temporary command, once it is shut down or restarted, it will no longer take effect and needs to be reconfigured. The next step is to configure the permanent command, which requires a new .zshrc file. First check if there is such a file, if not, create a new one, and open it.

 

 

14. Enter the source ~/.bash_profile effective statement in the .zshrc file, pay attention to lowercase. 

15. Finally, enter the source statement in the terminal to make it take effect. So far, mysql operation will not need to reconfigure environment variables because of shutdown or restart.

 

The above steps are installed and configured by watching the bloggers of Bilibili, which belong to study notes, and the sharing is for reference only, not suspected of commercial use.

Original video link: 【Software Installation|Super-detailed MySQL Installation under macOS-Bilibili】 https://b23.tv/YwHINFv

Guess you like

Origin blog.csdn.net/C3f128/article/details/129890097