MySQL basic Tutorial: mysql5.7.18 installation and connection tutorial, mysqlmysql5.7.18
Starting from this article, I will use a new series of articles to introduce and learn MySQL. Why do we need to learn MySQL? From a product perspective, most software database services still adopt relational databases, the main database products include Oracle, Microsoft MSSQL, IBM DB2, and MySQL. MySQL is the first choice for databases in many small and medium-sized website servers. It has a free version and a commercial version. It is currently a product of Oracle. From the perspective of testers, more and more software products are related to data, such as e-commerce and Database Service Query software products in a certain field. In addition to testing basic software functions, the company also hopes that testers can learn more about the business. Generally, these business data is mostly related to databases. Therefore, testers should master some basic database operations, write SQL query statements, and write SQL query statements as mentioned in many job introductions.
Simple addition, deletion, modification, and query of SQL statements. There are many articles and examples on the Internet. Here I want to install MySQL and make it easy to use, and then practice SQL query and writing so that I can have a more systematic understanding of SQL statements. Most of the time, you have online SQL practice statements, but you do not have an SQL Server environment. It is hard for you to understand and quickly master SQL statements. Therefore, the first article begins with installing the MySQL server and client, creating a database, and connecting to a database.
1. Download and install MySQL Server
1. Visit https://dev.mysql.com/downloads/mysql/. here we download the Free Community version.
2. In the drop-down list, find the Donwload button and select 32 or 64-bit based on the operating system version of your machine. The latest version is 5.7.18.
3. After the download is complete, the MySQL Server is installed by default. Other components are not checked.
4. During the installation process, create a password for the root user. Here, set the password to root, as shown in.
Click Add User to Add a DAB account: test/123456. Enter the User name and password, as shown in figure
Click Next. The installation is complete by default. After the MySQL Server is installed, the database services are started every time the computer is started. Now we have installed the database server. Next, we need to install a visual GUI client to connect to the database. Here we use MySQL Workbench.
Ii. Download and install MySQL Workbench
1. Open the web site https://dev.mysql.com/downloads/workbench/
2. Find "Windows (x86, 64-bit), MSI Installer"
3. Click Download.
4. On the new page, click the drop-down menu and click No thanks, just start my download.
5. Start download.
6. After the download is complete, start the installation. The interface is as follows:
Iii. Connect to the database on MySQL Workbench
Open MySQL Workbench. The interface is as follows:
If the installation is normal, MySQL Workbench will display the local database connection in MySql Connections, as shown in.
Click the gray background area and enter the root password. When installing MySQL Server, set the password to root. after entering the password, click Connect to connect to the local database. If this gray image does not exist, click the + button next to it. Based on the panel content, enter the user name and password and select the local service database. You can connect to the database.
1. Create a database db1
Click the red box and follow the prompts to create a new database. Enter db1 as the name and select UTF-8 as the encoding. The created database is displayed in the left-side pane.
Db1 is the new database, and sys is the default database after MySQL Server is installed. In the future, we will use MySQL Workbench to connect to our database, and then manually or SQL statements to create tables and other related data. The overall interface is as follows.
This section describes how to create tables and columns in the database db1.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.