之前想在自己的机器上搭建一个数据库,但是又怕占用内存太大,因此特地从网上下载了一个绿色版,免安装版本的,开始用着 还可以,后来重启机器发现悲催了,数据库用不了了,
决心好好整整Mysql 我的是 版本是:ysql-advanced-5.6.25-winx64 64位的Windows7 系统;
(1)重启机器后,进入 Services.msc无法启动,==>报错 1067 错误,去网上查,说需要在安装路径下的:
D:\tools\Mysql\V76384-01\mysql-advanced-5.6.25-winx64\mysql-advanced-5.6.25-winx64\ --》 这是我的安装路径
在安装路径下 把my-default.ini 从新复制一个 命名为 my.ini==> 我这样试了一下,直接导致我查了2天没法找到原因。到底哪里错了。
后来还是按照Mysql解压的文件,把复制的文件my.ini删了,可以启动了;看来网上的答案五花八门,不懂得原理,还是不行;
这是我的my-default.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 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [client] #password = your_password port = 3306 socket = /tmp/mysql.sock default-character-set=gbk [mysqld] port = 3306 socket = /tmp/mysql.sock default-character-set=gbk skip-locking key_buffer = 16K max_allowed_packet = 1M table_cache = 4 sort_buffer_size = 64K read_buffer_size = 256K read_rnd_buffer_size = 256K net_buffer_length = 2K thread_stack = 64K basedir =D:/tools/Mysql/V76384-01/mysql-advanced-5.6.25-winx64/mysql-advanced-5.6.25-winx64 datadir =D:/tools/Mysql/V76384-01/mysql-advanced-5.6.25-winx64/mysql-advanced-5.6.25-winx64/data server_id =10
(2) 在cmd中输入mysql 可以进入系统了;又发现了另一个问题,系统的密码忘了,需要修改root密码
查了 不少材料 发现此君写的在理:忘记了mysql数据库root用户密码,
他的方法我稍作了改动