- 下载
- my.ini配置
[mysql] default-character-set=utf8 [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 = D:\work\DB\mysql-5.7.17-winx64 datadir = D:\work\DB\mysql-5.7.17-winx64\data port = 3306 # server_id = ..... character-set-server=utf8 default-storage-engine=INNODB # 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
- 安装-启动
呵呵居然“没报任何错误”。(NET HELPMSG 3534)
查阅信息居然从5.7.6以后需要执行mysqld --initialize
3.1 执行mysqld -remove命令将以前的错误安装删除,否则会提示已经安装
3.2 执行mysqld --initialize
看error日志说data目录有东西了,清除data中的文件即可
3.3mysqld -install 然后 net start mysql启动服务
3.4mysql -uroot -p 意料之中的出现下面的提示
(Ps:在data目录下找一下安装日志ZB-PF0PP2TP.err,一般能找到临时密码,别忘了更改它。)
找不到的 如下方式解决( mysqladmin -u root password 密码 设置初始密码的方式没起效!!!)
mysqld --skip-grant-tables #skip-grant-tables的意思是启动MySQL服务的时候跳过权限表认证。
完事,可能需要你重新打开一个cmd窗口
mysql #进入mysql后
mysql> use mysql #Database changed
mysql> update mysql.user set authentication_string=password('123456') where user='root' and Host ='localhost'; #在之前的版本中,密码字段的字段名是 password,5.7版本改为了 authentication_string
mysql> flush privileges; #更新权限
mysql> quit
找到mysqld的进程kill掉或者注销系统重启
在进入mysql会提示让你重置密码(不知道为啥还让修改,推测上一步绕开权限检测)
mysql> set password for root@localhost = password('root');
mysql> flush privileges; #更新权限