mysql-5.6.20-win32 ,大小47MB
command line client 打不开(闪一下消失)的解决办法
mysql5.6 command line client 中启动mysql
原因是mysql找不到安装目录下的的 my.ini,将安装目录下的my-default.ini 复制改名为my.ini
重新启动 command line client 不要输入密码,登陆。
程序栏中 右单机 mysql5.6 command line client 可以看到启动mysql需要的参数。
例如 “-u root” , “-p” 默认没有密码,所以不用输入
设置mysql密码
将mysql设置为win7 服务
1)打开dos窗口,进入mysql的bin目录下,
2)执行mysqld --install mysql ,执行成功会提示Service Successfully Installed
3)那么你就可以在windows的服务中看到mysql这个服务了
服务将会开机启动,如果要 手动启动
mysqld.exe --install-manual
移除mysql服务
mysqld.exe --remove mysql
启动服务
net start mysql
关闭服务
stop start mysql
出现错误
mysql服务未启动错误1067
是my.ini的配置问题
可用的my配置
# 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.
[mysql]
default-character-set=utf8
[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 = d:\Mysql\mysql5611
datadir = d:\Mysql\mysql5611\data
default-storage-engine=MYISAM
port=3306
server-id=1
bind-address=0.0.0.0
character-set-server=utf8
# 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
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
这两个配置是为了保证中文的正常显示,根据需要修改为你期望的字符编码
[mysqld]
bind-address=0.0.0.0
这个配置是允许通过网络远程访问mysql服务,如果不去要,请删除此配置项,或者将地址改为:127.0.0.1
6.开始安装MySql
a) 以管理员身份打开cmd,定位到安装目录/bin下
b) 执行安装: mysqld --install MySql服务名
c) 启动MySql服务: net start MySql服务名
7. mysql缺省的root密码为空,修改密码的一种方法是:
a) mysql -u root -p
b) use mysql
c) update mysql.user set password="new password" where User="root";
d) flush privileges;
转载:http://www.cnblogs.com/northriver/archive/2013/06/07/3123385.html
CMD调用mysql命令:
环境变量的中添加:
MYSQL_HOME C:\Program Files\MySQL\MySQL Server 5.6
path ;%MYSQL_HOME%\bin;
保存就OK了