mysql8安装

作者: admin 分类: 数据库 发布时间: 2018-08-28 09:11
bin\mysqld --defaults-file=F:\command\mysql-8.0.12-winx64\my.ini --initialize-insecure
bin\mysqld --install Mysql8.0.12 --defaults-file=F:\command\mysql-8.0.12-winx64\my.ini
bin\mysqld --remove Mysql5.7.19
bin\mysqld --remove Mysql8.0.11
mysql -u root -P 3309 --skip-password

升级老的数据库文件(8.0.16之后不再需要此步骤)

mysql_upgrade -u root -P 3309
ALTER USER 'root'@'localhost' IDENTIFIED BY '12345yyz'

 

兼容

default_authentication_plugin=mysql_native_password
ALTER USER 'root'@'localhost'
IDENTIFIED WITH mysql_native_password
BY '12345yyz';

 

my.ini

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
basedir = F:/command/mysql-8.0.12-winx64
datadir = F:/command/mysql-8.0.12-winx64/data
tmpdir = F:/command/mysql-8.0.12-winx64/temp
port = 3309
# server_id = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
log-error= F:/command/mysql-8.0.12-winx64/data/error.log

long_query_time = 3
slow_query_log =1
slow_query_log_file = F:/command/mysql-8.0.12-winx64/data/slow-query.log

#explicit_defaults_for_timestamp=true

sql-mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
#default_authentication_plugin=mysql_native_password