如何在64位WIN7下安装64位的解压版mysql-5.6.37-winx64.zip
1、到mysql官網下載 https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.37-winx64.zip
2、將解壓縮后的文件放到自己想要的地方,并配置環境變量。例如我存放的目錄為:F:\mysql\mysql-5.6.14-winx64
在環境變量中添加:MYSQL_HOME:F:\mysql\mysql-5.6.14-winx64
在path路徑中加入:%MYSQL_HOME%\bin
配置環境變量不是必須的,只是為了能更方便的在命令行中使用mysql的命令行工具。
3、修改ini配置文件
5.6.14的解壓縮版里有一個my-default.ini文件,copy一份改名為my.ini放在同級目錄下。修改my.ini,遵照第二篇文章的做法。我的my.ini內容如下:
# 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 = .....
# datadir = .....
# 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
?
?[mysqld]
? #設置字符集為utf8
loose-default-character-set = utf8
basedir = E:\MySql\mysql-5.6.37-winx64
datadir = E:\MySql\mysql-5.6.37-winx64\data
character-set-server = utf8
[client]
loose-default-character-set = utf8
[mysql]
loose-default-character-set = utf8
[WinMySQLadmin]
server = E:\MySql\mysql-5.6.37-winx64\bin\mysqld.exe
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
4、安裝服務
????進入cmd:
(這個好像要管理員權限,我在C盤下搜索cmd.exe??-->??C:\Windows\winsxs\wow64_microsoft-windows-commandprompt_31bf3856ad364e35_6.1.7601.17514_none_f387767e655cd5ab\cmd.exe,右鍵以管理員身份運行。這個cmd.exe是64位的cmd。因為我安裝的是64位的mysql)
????輸入命令:
C:\>e:
E:\>cd E:\MySql\mysql-5.6.37-winx64\bin
E:\MySql\mysql-5.6.37-winx64\bin>mysqld?-install
Service?successfully?installed.
5、啟動服務
E:\MySql\mysql-5.6.37-winx64\bin>cd\
E:\>net?start?mysql
MySQL?服務正在啟動?.
MySQL?服務已經啟動成功。
6、配置用戶
還在上面的命令窗口里面,輸入命令:mysql?-u?root?-p
回車后提示輸入密碼。
mysql解壓縮版初次安裝管理員root的密碼為空,因此直接再回車一次就登入mysql數據庫了。
F:\>mysql?-u?root?-p
Enter?password:
Welcome?to?the?MySQL?monitor.??Commands?end?with?;?or?\g.
Your?MySQL?connection?id?is?1
Server?version:?5.6.14?MySQL?Community?Server?(GPL)
Copyright?(c)?2000,?2013,?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.
成功后
輸入命令:use?mysql; /*使用mysql數據庫*/
mysql>?use?mysql
Database?changed
輸入命令:select?host,user,password?from?user; /*?查看系統的賬戶信息?*/
mysql>?select?host,user,password?from?user;
+-----------+------+----------+
|?host??????|?user?|?password?|
+-----------+------+----------+
|?localhost?|?root?|??????????|
|?127.0.0.1?|?root?|??????????|
|?::1???????|?root?|??????????|
|?localhost?|??????|??????????|
+-----------+------+----------+
4?rows?in?set?(0.00?sec)
host:代表mysql服務允許哪個IP來的請求。localhost和127.0.0.1指mysql服務所在的主機,即本地。::1是IPV6的IP地址寫法,
全稱為:0000:0000:0000:0000:0000:0000:0000:0001。現在都是IPV4的網絡,可以不用管他。
user:指賬戶名稱。不同的host下賬戶名稱可以相同。
password:密碼。
可以看到,默認賬戶里只支持本地連接,并且賬戶沒有密碼。現在的問題明確了,就是要將匿名用戶刪除,為root用戶添加遠程訪問和密碼,再為自己添加個人賬戶。指令如下:
mysql>?update?user?set?password=PASSWORD('123456')?where?user='root';
Query?OK,?3?rows?affected?(0.00?sec)
Rows?matched:?3??Changed:?3??Warnings:?0
mysql>?grant?all?on?*.*?to?root@'%'?identify?by?'root';
ERROR?1064?(42000):?You?have?an?error?in?your?SQL?syntax;?check?the?manual?that
corresponds?to?your?MySQL?server?version?for?the?right?syntax?to?use?near?'ident
ify?by?'root''?at?line?1
mysql>?grant?all?on?*.*?to?walle@'%'?identify?by?'123456'?with?grant?option;
ERROR?1064?(42000):?You?have?an?error?in?your?SQL?syntax;?check?the?manual?that
corresponds?to?your?MySQL?server?version?for?the?right?syntax?to?use?near?'ident
ify?by?'123456'?with?grant?option'?at?line?1
mysql>?delete?from?where?user='';
ERROR?1064?(42000):?You?have?an?error?in?your?SQL?syntax;?check?the?manual?that
corresponds?to?your?MySQL?server?version?for?the?right?syntax?to?use?near?'where
?user='''?at?line?1
mysql>?select?host,user,password?from?user;
+-----------+------+-------------------------------------------+
|?host??????|?user?|?password??????????????????????????????????|
+-----------+------+-------------------------------------------+
|?localhost?|?root?|?*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B?|
|?127.0.0.1?|?root?|?*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B?|
|?::1???????|?root?|?*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B?|
|?localhost?|??????|???????????????????????????????????????????|
+-----------+------+-------------------------------------------+
4?rows?in?set?(0.00?sec)
mysql>?commit;
Query?OK,?0?rows?affected?(0.00?sec)
mysql>?flush?privileges;
Query?OK,?0?rows?affected?(0.00?sec)
?
轉載于:https://www.cnblogs.com/bjgua/p/7463199.html
總結
以上是生活随笔為你收集整理的如何在64位WIN7下安装64位的解压版mysql-5.6.37-winx64.zip的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C++ const的使用
- 下一篇: SQL2008R2的 遍历所有表更新统计