MySQL在x64系統上1067問題解決


最近一個項目需要用到MYSQL,因為以前也弄過,所以就沒怎么多想,直接下一個完事了。於是乎果斷上官方網站下了一個installer(5.26),修改了一下默認位置和配置,然后一路next,最后在配置完成啟動的時候,mysql installer一直停在attempting to start service。

想着是不是系統崩潰了(aliyun服務器,1G內存,server 2008R2,不是很流暢),重啟。

然后cmd》net start mysql56

 

彈出錯誤1067

 

於是噩夢開始了……

首先覺得是不是沒有安裝成功,重新來一次吧。於是卸載,再次安裝,問題依舊。每次安裝完成也不彈出配置的選項,我琢磨是不是有問題,翻了一下安裝log。

System Error :"Error 1918.Error installing ODBC driver Mysql ODBC 5.2 ANSI Driver

原來是這個問題…

查閱資料(http://www.cnblogs.com/rangeon/p/3410459.html),重新復制一個新名稱就可以了。mysql installer安裝的就是x86版本的。

 

終於odbc算是過了。

然后我想着沒啥問題了,於是重新安裝,依舊不能彈出配置界面,重試多次無果,services.msc中也找不到mysql56服務。

自己動手手動來把。

定位到mysql安裝目錄的bin文件夾

執行mysqld --install MySQL56 --defaults-file="{安裝目錄}\mydefault.ini"

service安裝成功。

 

net start mysql56,接着1067。

查看mydefault.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.
# server_id = .....
# basedir=
# datadir=
# port =

# 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

basedir、datadir、port都沒寫,填上相應路徑。

依舊不行。從網上找了一份my.ini配置成功,貼在下面給大家參考。

[client]
no-beep
port=3307

[mysql]
default-character-set=utf8

[mysqld]
port=3307
basedir="C:\Program Files\MySQL\MySQL Server 5.6\"
datadir="C:\Program Files\MySQL\MySQL Server 5.6\data\"
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-error="NAS.err"
max_connections=100
query_cache_size=0
query_cache_type=0
table_open_cache=2000
innodb_buffer_pool_size=10M
innodb_log_file_size=48M
innodb_concurrency_tickets=5000
innodb_stats_on_metadata=0
innodb_file_per_table=1
flush_time=0

注意:默認mysql端口3306,因為我的系統該端口已經被占用,因此改成3307。log-error="nas.err"是日志文件,會在data下生成,如果有錯誤查看這個就知道了,在配置文件不正確的時候經常出現

InnoDB: Assertion failure in thread xxxx in file ut0mem.cc line 105

InnoDB: Failing assertion: ret || !assert_on_error

還有就是請自己配置innodb_buffer_pool_size,原文配置的是256M,因為內存小,直接彈出系統錯誤1455,頁面文件不足,實際使用的時候請按照實際情況配置。


免責聲明!

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



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