64位Win10系統安裝Mysql5.7.11


       最近在裝了64位Win10系統的mac book筆記本上用mysql-installer-community-5.7.11.0安裝Mysql5.7.11,在配置mysql server時老是卡住,報錯。(在別的PC相同windows系統,自動安裝沒問題),估計是硬盤空間不夠,有些臨時文件無法保存的原因。於是手動安裝,這樣產生的臨時文件不多,最后成功安裝,步驟如下:

     一.准備安裝軟件

     1.mysql.com下載mysql-5.7.11-win32.zip

     2.mysql-workbench-community-6.3.6-win32.msi

     3.vcredist_x64 (第2步需要安裝MicroSoft Visual C++ 2013 Redistributable Package)

     二.安裝Mysql

     1.解壓mysql-5.7.11-win32.zip 到 c:\mysql-5.7.11-win32

     2.設置環境變量 MYSQL_HOME=c:\mysql-5.7.11-win32, path=%MYSQL_HOME%\bin

     3.關鍵一步是my.ini的設置,我的是

 1 [WinMySQLAdmin]   
 2 Server="C:/mysql-5.7.11-win32/bin/mysqld.exe"    
 4 [client]  
 5 no-beep  
 7 # pipe  
 8 # socket=mysql  
 9 port=3306   
11 [mysql]  
12   
13 default-character-set=utf8  
14  
15 # For advice on how to change settings please see  
16 # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html  
17 # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the  
18 # *** default location during install, and will be replaced if you  
19 # *** upgrade to a newer version of MySQL.    
21 [mysqld]  
23 explicit_defaults_for_timestamp = TRUE  
24 
25 # Remove leading # and set to the amount of RAM for the most important data  
26 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.  
27 innodb_buffer_pool_size = 2G  
28   
29 # Remove leading # to turn on a very important data integrity option: logging  
30 # changes to the binary log between backups.  
31 # log_bin  
32   
33 # These are commonly set, remove the # and set as required.  
34   
35 basedir="C:\mysql-5.7.11-win32\"  
36 datadir="C:\mysql-5.7.11-win32\data\"  
37   
38 port=3306  
39 server_id=1  
40   
41 general-log=0  
42 general_log_file="mysql_general.log"  
43 slow-query-log=1  
44 slow_query_log_file="mysql_slow_query.log"  
45 long_query_time=10  
47 log-error="mysql_error_log.err"    
50 default-storage-engine=INNODB  
51 max_connections=1024  
52 query_cache_size=128M  
53 key_buffer_size=128M  
54 innodb_flush_log_at_trx_commit=1  
55 innodb_thread_concurrency=128  
56 innodb_autoextend_increment=128M  
57 tmp_table_size=128M  
58   
59 # Remove leading # to set options mainly useful for reporting servers.  
60 # The server defaults are faster for transactions and fast SELECTs.  
61 # Adjust sizes as needed, experiment to find the optimal values.  
62 # join_buffer_size = 128M  
63 # sort_buffer_size = 2M  
64 # read_rnd_buffer_size = 2M   
65   
66 #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES   
67 sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"  
68 character-set-server=utf8  
69 innodb_flush_method=normal

    4. 管理員身份進入cmd(以下都是)

    5.mysqld --install MySQL --defaults-file=C:\mysql-5.7.11-win32\my.ini 安裝mysql服務

    6.mysqld --initialize 這是生成data目錄及初始化數據

    7.在data目錄mysql_error_log文件,找[Note] A temporary password is generated for root@localhost: 5ZC=7Qe&eneg,“:”后面紅色標識的三位便是初始密碼,或者:后面全部字符

    8.啟動服務net start mysql 或在服務中啟動

    服務默認啟動程序mysqld在C:\Program Files\MySQL\Mysql Server 5.7(如運行過自動安裝程序會有),如果沒有將mysqld拷到這里

    9.mysqld

    10.新開cmd, mysql -uroot -p

     輸入初始密碼連接進入mysql數據庫后,修改密碼如下:
     set password=password('123456');
     flush privileges;

     退出再次登錄,使用新密碼就行了:
     mysql -uroot -p123456

    三、為方便操作安裝workbench

   1.先安裝Visual C++2013 Redistributable Package

   2.安裝workbench 32位

   這兩步沒什么困難。

   好了,Mysql 5.7.11 32位在win10 64位系統安裝成功。

   最后提醒下,ODBC連接要裝32位的,使用C:\Windows\SysWOW64\odbcad32.exe配置

   

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM