windows下安装mysql5.6解压版,32位和64位均可

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/skmbw/article/details/12155427

对于32位和64位都是可以的。

1.复制mysql-5.6.14-win32.zip到D:\目录下.

2.解压mysql-5.6.14-win32.zip

3.在D:\mysql-5.6.14-win32下,

复制“my-default.ini”文件,生成“复件 my-default.ini”文件。将“复件 my-default.ini”文件重命名成“my.ini” 。

修改其中的内容如下:

<pre name="code" class="html"># 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.
[client]
default-character-set=utf8

[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-5.6.14-win32
datadir = D:\\mysql-5.6.14-win32\\data
port = 3306
#自定义主机ID识别符,用于主从或多服务器之间识别,为 一个 int 类型
server_id = 1

character_set_server=utf8

# 最大连接数量
max_connections = 100

#CREATE TABLE 语句的默认表类型,如果不自己指定类型,则使用下行的类型
default-storage-engine = InnoDB

# 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 



二、

D:\mysql-5.6.14-win32\bin配置到环境变量的path路径中。


三、安装mysql为windows服务。

d:\mysql-5.6.14-win32\bin\mysqld.exe -install mysql

一定要指定全路径,否则,可能找不到文件。


然后启动mysql服务。


如果是5.7需要先初始化数据库:

初始化和启动Mysql服务:

1.以管理员权限运行cmd

2.进入mysql的bin下

3.初始化,生成data文件夹

 >mysqld  --initialize-insecure (不设置root密码,建议使用)

 >mysqld  --initialize (生成一个随机的root密码)


然后执行net start mysql


四、登录修改mysql密码

cmd进入命令行

mysql -u root -p

回车 回车

进入数据库。

use mysql;

select host,user,password from user;

update user set password = PASSWORD('123456A') where user = 'root';


登录mysql之后,设置root密码

>set password for root@localhost = password('YourPassword');

或者使用mysqlamdin修改root密码

>mysqladmin -u root -p password NewPassword


最后不要忘记

flush privileges;

更新OK。

exit退出。然后重新登录即可。




展开阅读全文

没有更多推荐了,返回首页