This article mainly focuses on the installation and configuration of MySQL5.7 and MySQLWorkbench on the MAC operating system First, we can find the MySQL download page through the Oracle main menu, as shown in the figure below. MySQL is now also owned by Oracle. https://www.oracle.com/index.html You can also go directly to the MySQL download page through the following address. No matter which method you use, you will eventually reach the page below. https://www.mysql.com/downloads/ There are many information about MySQL products on this page, such as cloud service, enterprise edition, community edition, etc. This time we installed the community version, which is the open source free version. Scroll to the bottom of the page and find the link in the red box. MySQL Community Edition (GPL), this is the community edition. After entering, the page is as follows. The community version also provides many services. The most important one is of course MySQL Community Server (GPL), which is the database server service provided by MySQL. There is another tool on this page that we will introduce and install this time, MySQL Workbench (GPL) , which is a database visualization tool provided by the official website and is very easy to use. Click on the respective links to download Get two DMG installation packages The following is a detailed installation explanation, divided into two parts. 1. Installation of Mysql5.7.19. 2.MySQL5.7.19 related configuration. 3.Installation and configuration of MySQL Workbench. 1. Installation of Mysql5.7.19. Double-click the MySQL5.7.19 dmg installation file. Continue to open the pkg installation package and follow the prompts step by step, as shown in the figure below. A window will pop up here asking the user whether to agree to the license agreement. We click Agree. After the installation is complete, there is an important message here. The system automatically assigns a temporary password to the MySQL root super administrator user. We must save it, otherwise we will not be able to log in to the MySQL we just installed. 2.MySQL5.7.19 related configuration. After MySQL is installed, you still need to perform related system configuration. First we need to perform the initial login to MySQL. And change the initial password. Step 1: We need to turn on the MySQL server service or check whether the service is turned on. Open System Preferences as shown below Find the MySQL service below and click on it. After clicking, the service status is stopped, 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 need to use MySQL commands in the terminal to operate. First we need to know which directory MySQL is installed in. The installation file automatically places all files in the /usr/local directory. mysql is actually a link to mysql-5.7.19-macos10.12-x86_64. Using these two folders actually operates 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 in the bin 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 the full path to access, as shown 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 the command to an environment variable or create an alias. The specific operations are as follows: Open the terminal and enter: cd ~ Enter the ~ user's home directory and enter: sudo vim .bash_profile Press Enter to execute. You need to enter the root user password. Sudo is used by the root user to modify the environment variable file. At the bottom of the document, enter: export PATH=${PATH}:/usr/local/mysql/bin Then press esc to exit the insert state and enter :wq at the bottom to save and exit. Type: source .bash_profile Press Enter to execute and run the environment variables. After that, we can use all mysql commands directly in the terminal. Next, continue to modify the initial password. Enter mysql -u root -p in the terminal, press Enter, and enter the password. The -u option indicates the user name. Here, the super administrator user root is used. -p indicates logging in with a password. After successfully entering the mysql command page, you can change the password using the following command. Here I changed the password to root. set password for 'root'@'localhost'=password('root'); After changing the initialization password, we can use the database normally, for example, enter the show databases; command to view all databases in the server. The MySQL server configuration is complete. 3.Installation and configuration of MySQL Workbench. Open the Workbench dmg installation package. Drag MySQLWorkbench.app to the Applications folder to complete the installation. In the application, you can find MySQL Workbench and click it to open the program. After opening the program, enter the welcome interface of Workbench. Click the plus sign in the red box to add a connection. After clicking it, you need to configure the connection, enter the connection name Connection Name, server name Hostname, 127.0.0.1 represents the local machine, port Port defaults to 3306, username Username uses the super administrator root, click Store password Store in Keychain to save the database password, click it and enter the password, which is root like the username. There is a Test Connection button below, click it to see whether the connection is available. If it fails, it may be because the database service is not started or the username and password are incorrect. After the setting is successful, return to the page, you can see the previous connection, click to connect. After clicking the connection, you will enter the real visual interface of database operation. Various database operations can be performed on this page. The following is a query request. At this point, the installation and configuration of the latest version of MySQL 5.7 and Workbench has been demonstrated. If you have any questions, please ask them immediately and I will solve them as soon as possible. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Steps to create a Vite project
>>: How to view version information in Linux
MySQL slow log is a type of information that MySQ...
Preface The default database file of the MySQL da...
JBoss uses Tomcat as the Web container, so the co...
The problem of resetting the password for Zabbix ...
Preface The company's developers used the rep...
Mainly used knowledge points: •css3 3d transforma...
1. Introduction to VMware vSphere VMware vSphere ...
Recently I used MySQL to export table data to an ...
I saw an article in Toutiao IT School that CSS pe...
mysqldump command Introduction: A database backup...
Step 1: Create a Django project Open the terminal...
Table of contents Forward Proxy nginx reverse pro...
There are two ways to run .sh files in Linux syst...
I am a beginner in SQL and thought that the insta...
Table of contents 1. Declare a function 2. Callin...