The new version of the mysql database structures

mysql version: 8 , 0.16

mysql Download: https://dev.mysql.com/downloads/file/?id=485812

Download the complete decompress directly, and then configure the mysql environment variables.

Primarily the need to establish a my-default.ini file in the same directory of mysql bin. Follows

[mysqld] 
# 3306 port disposed 
Port = 3306 
# mysql installation directory setting 
the basedir = E: Software \\ \\ \\ mysql MySQL- 8.0 . . 11 - Winx64 # Important here must use a double slash \\ monoclinic bar I be wrong here, but look at the tutorial, some single slash. Try it yourself 
# Set the storage directory data mysql database 
datadir = E: \\ Software \\ \\ mysql mysql- 8.0 . 11 - Winx64 \\ here above the Data # 
# to allow the maximum number of connections 
max_connections = 200 
# allow the connection fails number of times. This is to prevent someone from trying to attack the host database system 
max_connect_errors = 10 
# character set used by the server defaults to UTF8 
Character - the SET -server = utf8 
default storage engine that will be used when creating a new table #
default -storage-Engine = INNODB 
# default "mysql_native_password" plug-in authentication 
default_authentication_plugin = mysql_native_password 
[mysql] 
# mysql client to set the default character set 
default -character- the SET = utf8 
[Client] 
# mysql client default settings when connected to the server port 
port = 3306 
default -character- the SET = utf8

Then executed in cmd (administrator privileges): mysqld --initialize --console

Marked red part is the initial password.

Followed by execution: mysql --install (initialization)

      net start mysql (start the database)

      mysql -u root -p (enter) Enter the initial password just below.

ok, so enter.

The following dozens of commonly used sql

ALTER USER 'root' @ 'localhost' IDENTIFIED WITH mysql_native_password BY 'new password'; (modified initial password)

CREATE USER 'xxh'@'%' IDENTIFIED WITH mysql_native_password BY 'xxh123!@#';(创建用户)

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON *.* TO 'xxh'@'%';(授权)

carry out! ! !

Above reference from https://www.cnblogs.com/laumians-notes/p/9069498.html

 

Guess you like

Origin www.cnblogs.com/smlPig/p/11026440.html