Install MySQL5.7.16 Procedure Records under Win7

  • 2021-06-28 09:51:14
  • OfStack

I have compiled a note about MySQL5.7.16 installation under Win7 for your reference:

1. Create a new MYSQL folder on the C disk;
2. Copy mysql-5.7.16-winx64 to the folder C:MYSQL, renamed mysql-5.7.16;
3. Under the directory mysql-5.7.16, build the file my.ini as follows:


[mysql]
#  Set up mysql Client Default Character Set 
default-character-set=utf8 
[mysqld]
# Set up 3306 port 
port = 3306 
#  Set up mysql Installation directory for 
basedir=C:\MYSQL\mysql-5.7.16
#  Set up mysql Storage directory for database data 
datadir=C:\MYSQL\mysql-5.7.16\data
tmpdir=C:\MYSQL\mysql-5.7.16\data
#  Maximum number of connections allowed 
max_connections=200
#  The character set used by the server defaults to 8 Bitcoded latin1 character set 
character-set-server=utf8
#  Default storage engine to be used when creating new tables 
default-storage-engine=INNODB

4. Run cmd.exe with administrator privileges and enter the C:MYSQLmysql-5.7.16bin directory;

5. Execute the command: mysqld -- initialize-insecure -- user=mysql, the data directory will be built automatically under the C:MYSQLmysql-5.7.16 directory;

6. Execute the command: mysqld install, install MySQL;

7. Execute the command: net start mysql, start MySQL;

8. Open MySQL and execute the command: mysql-uroot-p, there is no password by default, enter the password directly when you return;
Set password method: mysqladmin-u root-p password password
(mysqladmin -u root -p password mysql)

9. SQL used:
- > show databases;Find Database
- > use database name;Switch database directories
- > show tables;Lookup Table
- > sql Query Work select * from Table Name
- > exit exited.

10. Build your own database:


CREATE DATABASE  Database Name ;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON  Database Name .* TO  Database Name @localhost IDENTIFIED BY ' Password ';
SET PASSWORD FOR ' Database Name '@'localhost' = OLD_PASSWORD(' Password ');

CREATE DATABASE LFHDB;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON LFHDB.* TO LFHDB@localhost IDENTIFIED BY 'mysql';
-- Error executing below 
SET PASSWORD FOR 'LFHDB'@'localhost' = OLD_PASSWORD('mysql');

11. Remote login settings:

grant all PRIVILEGES on LFHDB.* to root@'10.211.55.2' identified by 'mysql';

LFHDB. * indicates which table the permissions above are for, LFHDB refers to the database, and * after that refers to all tables.
It can be inferred that "*. *" is authorized for all tables in all databases.
All tables in a 1 database are authorized as Database Name. *, and tables in a 1 database are authorized as Database Name. Table Name.

root indicates which user you want to authorize, either an existing user or a non-existent user.

10.211.55.2 indicates an IP address that allows remote connections. Set it to'%'if you want to unrestrict the IP for links.

mysql is the user's password.

How to open MySQL's remote account number-3) After the above statement is executed, the following statement can be executed for immediate effect.
> flush privileges;

Exciting feature sharing: mysql different versions of installation tutorials mysql5.7 various versions of installation tutorials


Related articles: