Use phpstudy to install and manage mysql database

One, phpstudy install and start the mysql database

1. Download the stable version installation package online, so I won’t go into details

2. Double-click the installation package and select custom installation

Insert picture description here

3. After clicking Install Now, the automatic installation will start, and wait patiently for the installation to be completed.

Insert picture description here

4. After completion, phpstudy will be run automatically and the mysql database will be started

Insert picture description here

  • The correct startup state is as follows:

Insert picture description here

Two, install mysql management software SQLyog

1. Download the SQLyog installation package online, so I won’t go into details

2. Double-click the installation package and click Next according to the prompts until the installation is complete (pay attention to the installation path)

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Insert picture description here
Insert picture description here

Three, configure mysql connection

1. Start sqlyog and select the language according to the prompt

Insert picture description here

  • Or select language on the menu
    Insert picture description here

2. Create a new connection and set the connection name

Insert picture description here

3. Configure mysql database related parameters

  • The main parameters are: host address, user name, password, port number
    Insert picture description here

4. Connection test and save the new connection

Insert picture description here

Fourth, visually create a database and related operations

1. Create a database: flask_demo

  • Right click on the left and select Create Database
    Insert picture description here
    Insert picture description here

2. Create a table

Insert picture description here

2.1 Table name: define yourself

2.2 Engine, character set, check

  • Engine: Choose InnoDB, generally choose some items, powerful
  • The character set, verification and the use of the innovative database are consistent to reduce anomalies

2.3 Setting fields

Insert picture description here
Insert picture description here

3. View and add data

Insert picture description here
Insert picture description here

Fourth, use the mysql database in the command line state

1.The premise of using mysql data in the command line state:

1.1 mysql recommends to use version 5.5 or above (do not choose the antique version)

1.2 Ensure that the mysql database is installed and successfully started

1.3 There is a mysql execution path in the system variable path

The following prompt appears, that is, the system variable is not set. For
Insert picture description here
example, the path that needs to be added to this machine is: D:\phpstudy_pro\Extensions\MySQL\bin

2. Enter the mysql command management interface

2.1 Enter in the command window: mysql -uroot -proot

  • The user name is root, the password is root, that is, there is no space between -u and the user name, and -p and the password
  • Insert picture description here

2.2 Display and select database

  • show databases;
  • use database name

Insert picture description here

3. Display the table and view the data

  • show tables;
  • select * from 表名
    Insert picture description here

4. Exit

  • exit;
    Insert picture description here

Guess you like

Origin blog.csdn.net/laoluobo76/article/details/109412389