DB_MYSQL_mysql-5.7.10-winx64解压版安装笔记

1.http://dev.mysql.com/downloads/mysql/ 里面下载Windows (x86, 64-bit), ZIP Archive

mysql-5.7.10-winx64.zip

 

2.解压在本地目录下

例:C:\05_study\mysql-5.7.10-winx64

 

3.在环境变量中添加:MYSQL_HOME:C:\05_study\mysql-5.7.10-winx64,在path路径中加入:%MYSQL_HOME%\bin。配置环境变量不是必须的,只是为了能更方便的在命令行中使用mysql的命令行工具。

4.修改my.ini配置文件

将my-default.ini拷贝一份,重命名为my.ini 内容要包含如下部分:

[mysqld]

loose-default-character-set=utf8

basedir="C:/05_study/mysql-5.7.10-winx64"

datadir="C:/05_study/mysql-5.7.10-winx64/data"

[client]

loose-default-character-set=utf8

[WinMySQLadmin]

Server=C:/05_study/mysql-5.7.10-winx64/bin/mysqld.exe

character-set-server=utf8

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

 

5.注意,不要自已手动去建C:/05_study/mysql-5.7.10-winx64/data文件夹。

6.安装服务

开始——所有程序——附件——命令提示符,右键以管理员身份运行。 输入命令:

 

C:\05_study\mysql-5.7.10-winx64\bin>mysqld --initialize-insecure --user=mysql

C:\05_study\mysql-5.7.10-winx64\bin>

C:\05_study\mysql-5.7.10-winx64\bin>mysqld -install

Service successfully installed.

C:\05_study\mysql-5.7.10-winx64\bin>net start mysql

The MySQL service is starting.

The MySQL service was started successfully.

C:\05_study\mysql-5.7.10-winx64\bin>

 在命令行启动mysql命令为: net start mysql      关闭mysql命令为:net stop mysql

如果要重装,先停掉mysql,再mysqld -remove 就可以卸载掉.

 

7.登录mysql,修改root用户密码为什123456

C:\05_study\mysql-5.7.10-winx64\bin>mysql -u root

Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.10 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| sys                |

+--------------------+

4 rows in set (0.00 sec)

mysql>use mysql

mysql>

mysql> update user set authentication_string=password('123456') where user='root ' and Host='localhost';

Query OK, 1 row affected, 1 warning (0.00 sec) Rows matched: 1  Changed: 1  Warnings: 1

mysql>

mysql> flush privileges;

mysql> quit

 

 8.远程登录配置 

允许root用户在任何地方进行远程登录,并具有所有库任何操作权限,具体操作如下:

1)在本机先使用root用户登录mysql:

命令行执行:mysql -u root -p

输入密码(第7步中设置的密码):123456

2)进行授权操作:

mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;

重载授权表:

mysql>FLUSH PRIVILEGES;

退出mysql:quit

 

转载于:https://www.cnblogs.com/rabbit20110807/p/5034801.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值