ps:mysql版本mysql-5.7.24-winx64.zip
1:下载mysql
mysql下载地址:(https://www.mysql.com/downloads/)
下面是图片操作顺序:
004.png
1.1:下载mysql-5.7.24-winx64.zip压缩包后解压。复制解压后的文件夹到本地自己的目录:D:\software\Mysql\mysql-5.7.24-winx64
005.png2:配置mysql的环境变量
1:MSYQL_HOME D:\software\Mysql\mysql-5.7.24-winx64
006.png
2:path 后面加 %MYSQL_HOME%\bin;
007.png
3:新建my.ini文件,文件配置内容:
[mysqld]
port = 3306
basedir=D:/software/Mysql/mysql-5.7.24-winx64 #ps:这里路径是/而非\
datadir=D:/software/Mysql/mysql-5.7.24-winx64/data
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
default-character-set=utf8
4:安装
4.1:以管理员身份进入cmd,进入到安装bin目录下,执行mysqld -install命令,显示Service successfully installed表示安装成功
C:\Windows\system32>d:
D:\>cd D:\software\Mysql\mysql-5.7.24-winx64
D:\software\Mysql\mysql-5.7.24-winx64>cd bin
D:\software\Mysql\mysql-5.7.24-winx64\bin>mysqld -install
Service successfully installed.
D:\software\Mysql\mysql-5.7.24-winx64\bin>
4.2:执行以下命令进行MySQL的初始化
D:\software\Mysql\mysql-5.7.24-winx64\bin>mysqld --initialize-insecure --user=mysql
D:\software\Mysql\mysql-5.7.24-winx64\bin>
4,3:执行命令
D:\software\Mysql\mysql-5.7.24-winx64\bin>net start mysql
发生系统错误 193。
*** 不是有效的 Win32 应用程序。
发生该错误后,百度得知:
D:\software\Mysql\mysql-5.7.24-winx64\bin有个mysqld的空文件,删除他即可。
删除后执行net start mysql启动成功
010.png
4.4:执行命令mysqladmin -u root -p password root 发生报错
D:\software\Mysql\mysql-5.7.24-winx64\bin>mysqladmin -u root -p password root
Enter password:
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
网友评论