码迷,mamicode.com
首页 > 数据库 > 详细

mysql安装配置

时间:2014-10-29 18:44:50      阅读:289      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   os   ar   使用   for   文件   数据   

1.首先到http://dev.mysql.com/ 上下载windows版,mysqlinstall,这个软件mysql为windows平台提供安装解决方案的软件,。

2.复制mysql下的my-default.ini, 在同目录下创建my.ini. my.ini为mysql的配置。最简单的配置:

bubuko.com,布布扣bubuko.com,布布扣

1 basedir=D:/mysql-5.6.20-winx64
2 datadir=D:/mysql-5.6.20-winx64/data

base config

我的配置为:

bubuko.com,布布扣bubuko.com,布布扣

 1 # For advice on how to change settings please see
 2 # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
 3 # *** DO NOT EDIT THIS FILE. It‘s a template which will be copied to the
 4 # *** default location during install, and will be replaced if you
 5 # *** upgrade to a newer version of MySQL.
 6 
 7 [mysqld]
 8 character-set-server=utf8
 9 
10 # Remove leading # and set to the amount of RAM for the most important data
11 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
12 # innodb_buffer_pool_size = 128M
13 
14 # Remove leading # to turn on a very important data integrity option: logging
15 # changes to the binary log between backups.
16 # log_bin
17 
18 # These are commonly set, remove the # and set as required.
19 # basedir = .....
20 # datadir = .....
21 # port = .....
22 # server_id = .....
23 basedir=D:/mysql-5.6.20-winx64
24 datadir=D:/mysql-5.6.20-winx64/data
25 port=3306
26 
27 character-set-server=utf8
28 default-storage-engine=INNODB
29 innodb_data_home_dir=D:/mysql-5.6.20-winx64/data
30 innodb_data_file_path=ibdata1:12M:autoextend
31 innodb_log_group_home_dir=D:/mysql-5.6.20-winx64/data
32 
33 innodb_buffer_pool_size=512M
34 # Remove leading # to set options mainly useful for reporting servers.
35 # The server defaults are faster for transactions and fast SELECTs.
36 # Adjust sizes as needed, experiment to find the optimal values.
37 # join_buffer_size = 128M
38 # sort_buffer_size = 2M
39 # read_rnd_buffer_size = 2M 
40 
41 # sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

my.ini

3.设置环境变量PATH。将D:\mysql-5.6.20-winx64\bin加入path中。

4.CMD下面尝试启动mysqld,并将后台log输出在屏幕。

bubuko.com,布布扣

5.注册mysql为windows service. 以后可以使用windows service来安装mysqld和卸载mysqld的服务.

bubuko.com,布布扣

6.进入服务管理器

bubuko.com,布布扣

7.启动MySQL服务

bubuko.com,布布扣

8.net start mysql 启动mysql服务,net stop mysql 停止mysql服务

bubuko.com,布布扣

9.也可以使用mysqladmin命令关闭mysql服务。

bubuko.com,布布扣

10.使用root用户登录mysql数据库

bubuko.com,布布扣

11.show databases;显示所有数据库

bubuko.com,布布扣

12.修改root帐户的登陆密码1234:

bubuko.com,布布扣

13.创建数据库需要指定中文编码方式

bubuko.com,布布扣

14.查看MySQL存储引擎

bubuko.com,布布扣

15.创建mysql远程连接用户,设置最大权限和登陆密码。

bubuko.com,布布扣

还有一些测试mysql安装的命令:

bubuko.com,布布扣bubuko.com,布布扣bubuko.com,布布扣

 

 

如果发生启动错误的情况,一般是my.ini没有配置成功。

可以查看根目录下的*.err文件,针对具体情况进行排查。

其中有一种情况是将ib_logfile0,ib_logfile1删除以后,重启即可。

mysql安装配置

标签:blog   http   io   os   ar   使用   for   文件   数据   

原文地址:http://www.cnblogs.com/SSatyr/p/4059812.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!