标签:
1.解压mysql-5.6.26-winx64.zip到任意位置,如:c:\
2.设置环境变量.
3.copy一份my-default.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. #mysql根目录 basedir =C:\mysql-5.6.20-winx64 #数据文件存放目录 datadir =C:\mysql-5.6.20-winx64\data # port = ..... 端口,默认3306 # 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
3.以管理员运行cmd,执行
mysqld -install
将MySQL的安装到windows的服务,可以用
services.msc
查看MySQL服务已经启动;
mysqld –remove 将卸载服务
4.启动MySQL服务
net start mysql
net stop mysql 将停止服务
5.登陆
mysql -u root -p
第一次运行密码为空;
修改密码:
mysqladmin -uroot -p password <新密码>
运行:
show variables like ‘%version%‘;
查看数据库的相关信息:
标签:
原文地址:http://www.cnblogs.com/lycsky/p/4813297.html