Windows 安装 MySQL 8 野性酷女 2023-10-18 22:06 62阅读 0赞 cd C:\\mysql\\ md data notepad my.ini \[mysqld\] \#严格模式 sql\_mode=STRICT\_ALL\_TABLES \# 设置3306端口 port=3306 \# 设置mysql的安装目录 basedir=C:\\mysql\\data \# 设置mysql数据库的数据的存放目录 datadir=C:\\mysql\\data \# 允许最大连接数 max\_connections=2000 \# 允许连接失败的次数。 max\_connect\_errors=10 \# 服务端使用的字符集默认为UTF8 character-set-server=utf8 \# 创建新表时将使用的默认存储引擎 default-storage-engine=INNODB \# 默认使用“mysql\_native\_password”插件认证 \#mysql\_native\_password default\_authentication\_plugin=mysql\_native\_password \[mysql\] \# 设置mysql客户端默认字符集 default-character-set=utf8 \[client\] \# 设置mysql客户端连接服务端时默认使用的端口 port=3306 default-character-set=utf8 Microsoft Windows \[版本 10.0.17763.615\] (c) 2018 Microsoft Corporation。保留所有权利。 C:\\WINDOWS\\system32>cd \\mysql C:\\mysql>cd bin C:\\mysql\\bin>mysqld -install Service successfully installed. C:\\mysql\\bin>mysqld --initialize C:\\mysql\\bin>net start mysql MySQL 服务正在启动 .. MySQL 服务已经启动成功。 C:\\mysql\\bin>mysql -uroot -p Enter password: \*\*\*\*\*\*\*\*\*\*\*\*\* ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) C:\\mysql\\bin>mysql -uroot -p Enter password: \*\*\*\*\*\*\*\*\*\*\*\* Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is 9 Server version: 8.0.16 Copyright (c) 2000, 2019, 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. Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.02 sec) mysql> \\e mysql> exit Bye C:\\mysql\\bin>mysql -uroot -p Enter password: \*\*\*\*\*\* Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is 10 Server version: 8.0.16 MySQL Community Server - GPL Copyright (c) 2000, 2019, 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. Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement. mysql>
还没有评论,来说两句吧...