Installation and setup mysql8

mysql8 installation

EDITORIAL

  • And overall almost 5. * version, but the installation success depends on details

    download

    Click https://dev.mysql.com/downloads/file/?id=476233, can also point here , there are account can log on, did not choose the lowest skipped.

    Installation and Startup

  1. Add the bin to the environment variable path below, win10 note that each variable is a new line, not the last in a semicolon
  2. Adding the my.ini profile (renamed and suffix can directly txt), as follows, ANSI encoding format is selected from
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
#设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=E:\mysql-5.6.42-winx64
# 设置mysql数据库的数据的存放目录 data后面的命令会生成
datadir=E:\mysql-5.6.42-winx64\data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
  1. Run as Administrator command line and cut to the mysql bin directory, and then execute the following statement, do not close this window, find the initialization code in it
mysqld --initialize --console
  1. install service
// 服务名可以不写,默认的名字为 mysql
mysqld --install [服务名]
  1. Start Service
// 注意服务名,没有写就是mysql
net start mysql
  • other
// 停止服务
net stop mysql 
// 卸载 MySQL
sc delete MySQL/mysqld -remove

Set up

  • Change Password (password to log into first with initialization)
mysql -u root -p

Then execute

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';  
  • Set external network access
// 进入mysql库
use mysql
// 更新域属性,'%'表示允许外部访问
update user set host='%' where user ='root';
// 更改生效
FLUSH PRIVILEGES;
// 再执行授权语句
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;
  • Navicat connection
  1. Above Navicat12 version is no different, directly connected
  2. Navicat12 following changes encryption caching_sha2_password-> mysql_native_password
update user set plugin='mysql_native_password' where user='root';
  • Do not have access to see whether the port through the firewall, try not directly related to the firewall (investigation and the reasons can try)

Guess you like

Origin www.cnblogs.com/ants_double/p/11202032.html