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
3. After clicking Install Now, the automatic installation will start, and wait patiently for the installation to be completed.
4. After completion, phpstudy will be run automatically and the mysql database will be started
- The correct startup state is as follows:
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)
Three, configure mysql connection
1. Start sqlyog and select the language according to the prompt
- Or select language on the menu
2. Create a new connection and set the connection name
3. Configure mysql database related parameters
- The main parameters are: host address, user name, password, port number
4. Connection test and save the new connection
Fourth, visually create a database and related operations
1. Create a database: flask_demo
- Right click on the left and select Create Database
2. Create a table
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
3. View and add data
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
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
2.2 Display and select database
- show databases;
- use database name
3. Display the table and view the data
- show tables;
- select * from 表名
4. Exit
- exit;