In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This paper mainly focuses on the installation and configuration of Mysql5.7 and MySQLWorkbench on MAC operating system.
First of all, we can find the download page of MySQL through the menu on the main side of Oracle, as shown in the following figure. MySQL is now under the control of Oracle.
Https://www.oracle.com/index.html
You can also go directly to the download page of mysql through the address below. Either way, you will eventually reach the following page.
Https://www.mysql.com/downloads/
There is a lot about MySQL products on this page, such as cloud services, enterprise editions, community editions, etc. This time we installed the community version, that is, the open source free version.
Pull to the bottom of the page and find the link in the red box. MySQL Community Edition (GPL), this is the community version.
After entering, the page is as follows, and the community version also provides a lot of services. The most important, of course, is MySQL Community Server (GPL), which is the service that MySQL provides on the database server side. This page is also this time to introduce and install, MySQL Workbench (GPL), which is a database visualization tool, officially provided, very easy to use.
Click on their respective links to download
Get two DMG installation packages
The following is a detailed installation explanation, which is divided into two parts.
1. Installation of Mysql5.7.19.
The relevant configuration of 2.MySQL5.7.19.
Installation and configuration of 3.MySQLWorkbench.
1. Installation of Mysql5.7.19.
Double-click the dmg installation file for MySQL5.7.19.
Continue to click on the pkg installation package and follow the prompts step by step, as shown in the following figure.
A window will pop up to ask the user if they agree to the license agreement. We agree with Agree.
After the installation is complete, here is an important message. The system automatically assigns a temporary password to the root Super Admin user of MySQL. We have to save it, or we won't be able to log in to the MySQL we just installed.
The relevant configuration of 2.MySQL5.7.19.
After the MySQL installation is complete, the relevant system configuration is required. First of all, we need to do the initial login of MySQL. And change the initial password.
Step 1: we need to open the server service for MySQL or check whether the service is turned on.
Open system preferences, as shown below
Locate the MySQL service below and click on it.
After clicking on, the service status is stopped stop, and then we click the Start MySQL Server button to start the service.
After starting the service, you can see that the service status is running. If you want to shut down the server later, you can find it here and click Stop MySQL Server.
Step 2: change the initial password.
After starting the server, we will use the command of MySQL at the terminal to operate.
First of all, we need to know which directory MySQL is installed in, and the installation files automatically put all the files in the / usr/local directory. Mysql is actually a link to mysql-5.7.19-macos10.12-x86_64, and using both folders is actually working with the same files.
So the home directory of MySQL is as follows:
/ usr/local/mysql-5.7.19-macos10.12-x86_64
MySQL commands are all under the bin of the home directory, such as the most important mysql mysqladmin command
/ usr/local/mysql-5.7.19-macos10.12-x86_64/bin or
/ usr/local/mysql/bin
For such commands, we can use full path access, such as the usage below, or we can add the command to the environment variable.
/ usr/local/mysql-5.7.19-macos10.12-x86_64/bin/mysql-u root-p
/ usr/local/mysql/bin/mysql-u root-p
It is recommended to configure commands to environment variables or aliases.
The specific operations are as follows:
Open the terminal and enter: cd ~
Enter the ~ user's home directory and enter: sudo vim .bash _ profile
Enter the root user password for execution. Sudo uses root users to modify the environment variable file.
At the bottom of the document, enter: export PATH=$ {PATH}: / usr/local/mysql/bin
Then esc exits the insert status and type: wq to save the exit at the bottom.
Enter: source .bash _ profile
Enter execution, run environment variables.
When it is over, we can use all the commands of mysql directly on the terminal.
Then go on to change the initial password.
Enter mysql-u root-p at the terminal, enter the enter, and enter the password. The-u option indicates the user name, and here the Super Admin user root,-p indicates login with a password.
After successfully entering the mysql command page, you can change the password with the following command. Here I change the password to root.
Set password for 'root'@'localhost'=password (' root')
After changing the initialization password, we can use the database normally, such as typing the show databases; command to view all the databases on the server.
The MySQL server configuration is complete.
Installation and configuration of 3.MySQLWorkbench.
Open the dmg installation package for Workbench. Drag MySQLWorkbench.app into the Applications folder to complete the installation.
In the application, you can find MySQLWorkbench, click to open the program.
After opening the program, go to the welcome interface of Workbench.
Click the plus sign in the red box to add a connection.
After clicking on, you need to configure the connection. Enter the connection name Connection Name, the server name Hostname,127.0.0.1 represents the local machine, the port Port defaults to 3306, the user name Username uses Super Admin root, click and store the password Store in Keychain to save the password of the database, and enter the password after clicking. Here is the same as the user name, and there is a test connection button Test Connection below. After clicking, you can see whether the connection is available, if it is not successful. This may be due to the failure to start the database service, or the wrong username and password.
After the setting is successful, go back to the page, you can see the connection just now, click on the connection to enter.
After clicking the connection, you will enter the visual interface of the real database operation.
Various database operations can be performed on this page, and here is a query request.
At this point, the installation and configuration of the latest version of MySQL5.7 and Workbench will be demonstrated. If you have any questions, please raise them immediately and I will solve them as soon as possible.
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.