完成的命令
C:\Windows\system32>g:
G:\>cd G:\database\mysql\bin
G:\database\mysql\bin>mysqld --initialize --user=mysql --console
G:\database\mysql\bin>mysqld -install
G:\database\mysql\bin>net start mysql
G:\database\mysql\bin>mysql -u root -p
Enter password: ************
mysql> alter user root@localhost identified by "12345";
mysql> show variables like 'character%';
E:\IDES\mysql-5.7.11-winx64\bin
[client] #增加的内容
#password = your_password
port = 3306
socket = /tmp/mysql.sock
default-character-set=utf8
[mysqld] #修改的内容
port = 3306
socket = /tmp/mysql.sock
character-set-server=utf8
character-set-filesystem = utf8
如图2.0
C:\WINDOWS\system32>mysqld --initialize --user=mysql --console
如图
C:\WINDOWS\system32>mysqld -install
Service successfully installed.
C:\WINDOWS\system32>net start mysql
MySQL 服务正在启动 ..
MySQL 服务已经启动成功。
如图
C:\WINDOWS\system32>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.11
Copyright (c) 2000, 2016, 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 "12345";
Query OK, 0 rows affected (0.00 sec)
如图3.5
mysql> show variables like 'character%';
C:\WINDOWS\system32>net start mysql MySQL 服务正在启动 . MySQL 服务无法启动。 服务没有报告任何错误。 请键入 NET HELPMSG 3534 以获得更多的帮助。 如图
C:\Windows\system32>net start mysql 发生系统错误 2。
系统找不到指定的文件。
mysqld -remove
,然后cd 进入MySQL解压目录的bin目录下,再次执行mysqld -install
和net start mysql
即可。原因,默认生产的文件路径至c盘中,所以无法找到。