Personal Summary of mysql 5.7 Database Installation Steps

  • 2021-09-12 02:32:57
  • OfStack

1. mysql-5. 7.19-winx64. zip (this is an installation-free version, about 318 megabytes, and one is an installation version, about 380 megabytes mysql-installer-community-5. 7.19. 0. msi) Unzip this installation package to the designated disk
2. It is best to change the unzipped file name to mysql
3. See if there is data folder under mysql folder. If not, create a new one
4. Open the mysql folder and create a new my. ini (note this format) file to overwrite my-default. ini (it doesn't matter if you don't see this file)
5. my. ini is like this
[mysql]
# Set the default character set for mysql clients
default-character-set=utf8
[mysqld]
# Set Port 3306
port = 3306
# Set the installation directory for mysql
basedir=D:\ mysql//Modify to your installation directory
# Set the directory for storing data in mysql database
datadir=D:\ mysql\ data//Modify to your own installation directory
# Maximum number of connections allowed
max_connections=1000
The character set used by the server defaults to the 8-bit encoded latin1 character set
character-set-server=utf8
# Default storage engine to use when creating new tables
default-storage-engine=INNODB

6. Open cmd and find the bin directory, such as D:\ > cd mysql\ bin Input Command: D:\ mysql\ bin > mysqld -install
Get this feedback: Service successfully installed.
7. Enter the command: mysqld--initialize initialize 1 time (slightly longer)
8. Start mysql
D:\mysql\bin > net start mys
The MySQL service is starting.
The MySQL service has started successfully.
9. Because the password is automatically generated in the newly installed database, you need to open the mysql\ data folder to find the computer name-PC. err file.
Open to find the line porary password is generated for root @ localhost: RF% B: iXgo1sp
This RF% B: iXgo1sp is the automatically generated password, and then login to mysql, mysql-uroot-p to copy the password.
Then change the password you want: Command: set password for root @ localhost = password ('New Password');
10. Database 1 is installed successfully. Welcome to mysql database


Related articles: