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

Mysql server 5.7.20 installation and configuration method graphic text tutorial

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article records the installation and configuration method of mysql 5.7.20 and shares it with you.

Download MySQL

First, go to the database's official website http://www.mysql.com to download MySQL.

Click to enter the home page as follows:

Then click downloads,community and select MySQL Community Server. As shown below:

Slide below, find Recommended Download, and click go to download page. As shown below:

Click download to enter the download page and select No thanks, and just start my download can start downloading. Of course, you can also register if you want to register.

Second, install MySQL

Open the installation package you just downloaded and start installing MySQL.

Select I accept and click next to proceed to the next step.

Select Developer Default here, and then click next to proceed to the next step.

This step is to check the installation conditions, just click next to proceed to the next step.

Just click execute to execute here, and then click next to proceed to the next step.

Continue to click next to proceed to the next step.

Select the first one and click next to proceed to the next step.

Just click next here to proceed to the next step.

Set the root password and click next to proceed to the next step.

Click next to proceed to the next step.

Continue to click next.

Click execute to execute.

Click next.

Click finish.

Click next all the way, and check your root password, and MySQL will be successfully installed on your computer.

After the installation is completed, enter the installation directory of MySQL and enter MySQL Sever. The files in its directory are as follows:

Bin directory saved MySQL commonly used command tools and management tools, data directory is the default MySQL to save data files and log files (because I just installed there is no data folder), docs directory is MySQL help documents, include directory and lib directory are MySQL dependent header files and library files, share directory to save directory files and log files.

Enter the bin directory, hold down the shift key and click the right mouse button to choose to open the command window in that directory, or enter cmd in the address bar to enter the command window. Enter mysql-u root-p and enter, and then you will be prompted for a password. After entering the password, you will enter the operation and management interface of MySQL.

Enter show databases; (note the semicolon at the end) to view the list of databases in the current MySQL, enter use test; to enter the test database (if you have this database), enter show tables to view all the tables in the test database, and enter quit to exit the operation and management interface of MySQL.

3. Basic MySQL usage tutorial (using MySQLworkbench)

1. Create a database

You can create a database directly using the create database on the toolbar, as shown in the following figure:

Or use the command: create database database name; (note the semicolon at the end) to create it. Note that this method may not be refreshed immediately, you can right-click in the lower left corner and select Refresh all to refresh.

2. Create and delete tables

You can right-click on the Tables where you want to create the table, select Create Table, or use the command create table table_name (column_name column_type)

Note that before creating a datasheet command, you need to use use to indicate the database you want to use. (you can right-click on the database you are going to use and select Set as Default Schema to make the database you are going to use default, so that you do not have to write use statements.)

Delete a table by commanding drop table table_name;.

3. Change the name of the table

Change the data table name by using the command: alter table old_name rename to new_name or rename table old_name to new_name.

4. Add, modify and delete fields to the data table

Add fields to the data table by command alter table table_name add column_name column_type; statement.

Modify the data table field name by using the command alter table table_name change column_name new_column_name new_column_name_type; statement.

Delete the datasheet field with the command alter table table_name drop column_name;.

5. About changing the name of the database

In the lower version of MySQL, a command rename is provided to modify the name of the database (note that it is not the table of the database), but this command will cause data loss, so this command has been deleted. Now if you want to rename a database, you need to export all the data in the original database, then create a new database, and then import the exported data into the new database. Finally, delete the original database. The whole process is tedious, and it will be a waste of time when there is a large amount of data, so it is not recommended to change the name of the database, so when naming the database, we should consider that we should give the database a reasonable name.

6. Expansion: pycharm operates MySQL

Open pycharm, follow the instructions on the picture, click the green "+" and then select MySQL

Then set the name, and set to connect to the database in the way of root, and finally test the success of the connection and click apply.

The effect of the connection is shown in the following figure. After setting it, you can write the command of MySQL in pycharm, and the IDEA of Java can also be set.

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.

Share To

Database

Wechat

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

12
Report