当前位置:网站首页>MySQL installation configuration and creation of databases and tables

MySQL installation configuration and creation of databases and tables

2022-07-05 09:32:00 This card

mysql Installation configuration

1、 install

In view of my own environment window11, So what is shown here is win Installation of version
Installation address :https://dev.mysql.com/downloads/mysql/

 Insert picture description here
Here I choose the last Windows (x86, 64-bit), ZIP Archive, Click the corresponding download
 Insert picture description here
After entering the interface , Don't worry about these registration contents , Click on no thanks,just start my download Can
stay c disc ( You can also choose by yourself ) Create a mysql Folder , Then extract the downloaded compressed package into it
 Insert picture description here

2、 To configure

After the above steps, we will configure
First create a my.ini file , Enter the following ( Be careful : among basedir It must be your own installation directory !!!)

[client]
#  Set up mysql Client default character set 
default-character-set=utf8
 
[mysqld]
#  Set up 3306 port 
port = 3306
#  Set up mysql Installation directory 
basedir=C:\\mysql\\mysql-8.0.29-winx64 
#  Set up  mysql Database data storage directory ,MySQL 8+  The following configuration is not required , The system can be generated by itself , Otherwise, it is possible to report an error 
# datadir=C:\\mysql\\mysql-8.0.29-winx64
#  Maximum connections allowed 
max_connections=20
#  The character set used by the server defaults to 8 Bit coded latin1 Character set 
character-set-server=utf8
#  The default storage engine that will be used when creating a new table 
default-storage-engine=INNODB

Then configure it in the system environment ( As in the last line )
 Insert picture description here

3、 start-up

open cmd, Toggle directory ( Own directory !!)

cd C:\mysql\mysql-8.0.29-winx64\bin

Initialize database

mysqld --initialize --console

After execution, the following initial password will be displayed

...
2022-04-20T02:35:05.464644Z 5 [Note] [MY-010454] [Server] A temporary password is generated for [email protected]: APWCY5ws&hjQ
...

Here, for example. APWCY5ws&hjQ It's the initial password

4、Navicat install

For better use mysql, It is recommended to install another graphical interface navicat To operate mysql
Install Links https://www.navicat.com/en/download/navicat-for-mysql
 Insert picture description here
What I have installed here is win64 Trial version of bit
Download and run exe file
 Insert picture description here
Click on next
 Insert picture description here
Click on accept
 Insert picture description here
Select the installation directory

 Insert picture description here
Whether to install shortcuts
 Insert picture description here
Click Install to wait for installation
 Insert picture description here
installation is complete

5、 Build a database

Here I show a database establishment process , It is mainly to establish the per capita wage level in all parts of China
Start by opening navicat for sql Link
 Insert picture description here
Choose to write a connection name, Input password, Then the link is successful
 Insert picture description here
Right click to create a new database
 Insert picture description here
Name the new database , And standardize the database as utf-8 code
 Insert picture description here
Double click to open this database , Create a new table
 Insert picture description here
Create a table structure , Enter the corresponding field
 Insert picture description here
After saving, you can edit the data
 Insert picture description here

原网站

版权声明
本文为[This card]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050925000380.html