Mysql installation step on pit notes
Mysql install uninstall several times and finally succeeded, he stepped on the record about the pit
Into the pit
The first is the official website to download version 8.0.18
starting at the time of installation to the end of the server always unsuccessful
log display problems
MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
Failed to connect to MySQL Server 8.0.18 after 10 attempts.
Ended configuration step: Starting the server
Then look at the recommendations of friends, find mysql80 service, right> properties> log on, change the cost to the system account> OK, re-run success, but I did not succeed
portal
Then uninstall, version 5.7.28 Download low
I was in accordance with the recommendations of friends unloading Portal
but I uninstall process no other extra steps, just uninstall is complete, additional steps I have checked, and no extra files .
C: \ Documents and Settings directory needs to show uncheck Hide protected file, and then give full control
Download version 5.7
Download the compressed version, you will be able to directly extract
- After decompression, My Documents directory
D: \ Users \ Jsong \ tools \ Mysql \ mysql-5.7.22-winx64 - New my.ini file in this directory, choose the encoding format ANSI format encoding
nodepad format> encoded in ANSI format
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
#设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=D:\\Users\\Jsong\\tools\\Mysql\\mysql-5.7.22-winx64
datadir=D:\\Users\\Jsong\\tools\\Mysql\\mysql-5.7.22-winx64\\data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
Note To use \\
the basedir = D: \\ \\ Jsong the Users Tools \\ \\ \\ Mysql MySQL-5.7.22-Winx64
DATADIR = D: \\ \\ Jsong the Users Tools \\ \\ \\ Mysql MySQL- 5.7.22-winx64 \\ data
Otherwise Mysql initialization of have this problem
mysqld: Can't create/write to file 'D:\Users\Jsong ools\Mysql\mysql-5.7.22-winx64\data\is_writable' (Errcode: 2 - No such file or directory)
2019-11-09T02:16:53.861687Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-11-09T02:16:53.862353Z 0 [ERROR] Can't find error-message file 'D:\Users\Jsong ools\Mysql\mysql-5.7.22-winx64\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2019-11-09T02:16:53.864165Z 0 [ERROR] --initialize specified but the data directory exists and is not writable. Aborting.
2019-11-09T02:16:53.864376Z 0 [ERROR] Aborting
- Installed
in the D: \ Users \ Jsong \ tools \ Mysql \ mysql-5.7.22-winx64 \ bin directory to perform
mysqld install
The emergence of new problems
could not start (0xc000007b) normal
download driectx
refer to this article
- Initialize the database
will be in D: \ Users \ Jsong \ tools \ Mysql \ data folder to generate a database file \ mysql-5.7.22-winx64
mysqld --initialize
- Kai Services
net start mysql
- Connect to the database
mysql -u{username} -p{password}
- Check the root user password
D: \ Users \ Jsong \ tools \ Mysql \ mysql-5.7.22-winx64 \ data \ xxx.err
file written secret root @ localhost: 7lKyqqMt 0TU!
2019-11-09T02:19:16.178984Z 1 [Note] A temporary password is generated for root@localhost: 7lKyqqMt!0TU
- log in
mysql -uroot -p7lKyqqMt!0TU
D:\Users\Jsong\tools\Mysql\mysql-5.7.22-winx64\bin>mysql -uroot -p7lKyqqMt!0TU
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.7.22
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
- change Password
alter user root@localhost identified by ‘1’;
mysql> alter user root@localhost identified by '1';
Query OK, 0 rows affected (0.00 sec)
- drop out
exit;
- Out of service
net stop mysql