网上MySQL安装的文章有很多哈,但是今天在自己的笔记本上安装遇到了问题,仅此做下记录。
1、下载MySQL的zip压缩包,在官网https://dev.mysql.com/downloads/mysql/ 根据需要下版本 Windows有32位和64位的。
2、下载下来之后解压到你指的文件夹。这是我解压后的路径。
3、配置环境变量,和配置Java的环境变量一样。
4、更改数据库配置文件。将根目录下的my-default.ini复制一份重命名为my.ini
更改里面的配置,注意里面的文件路径 一定要加英文的双引号。
<span style="font-size:14px;"># For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [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:/Program Files/mysql-5.6.36-winx64" datadir ="D:/Program Files/mysql-5.6.36-winx64/data" # port = ..... # server_id = ..... # 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 #服务端的编码方式 character-set-server=utf8 [client] #客户端编码方式,最好和服务端保存一致 loose-default-character-set = utf8 [WinMySQLadmin] Server = "D:/Program Files/mysql-5.6.36-winx64/bin/mysqld.exe" </span> |
5、安装mysql服务 ,dos窗口切换到MySQL的bin 目录下 执行命令
mysqld -install |
我的出了问题,网上找了下说是缺少Microsoft Visual C++ 2010 运行库。
好吧,去官网下 这个 安装好重启了 服务安装成功。
运行services.msc查看注册的服务,然后启动MySQL服务。
到此我们MySQL服务器已经安装完毕了。
6、登录MySQL服务器,重新设置密码。
新闻热点
疑难解答