mysql 解压安装

  1. 解压

  2. 配置环境变量

    path追加:D:\myprogram\mysql-5.7.11-winx64\bin;

  3. 配置my.ini文件

    basedir = D:\myprogram\mysql-5.7.11-winx64

    datadir = D:\myprogram\mysql-5.7.11-winx64\data

    创建data目录

  4. 加入Windows服务

    D:\myprogram\mysql-5.7.11-winx64\bin>mysqld -install

    Service successfully installed.

    D:\myprogram\mysql-5.7.11-winx64\bin>net start mysql

    MySQL 服务正在启动 ...

    MySQL 服务无法启动。

    服务没有报告任何错误。

    请键入 NET HELPMSG 3534 以获得更多的帮助。

    D:\myprogram\mysql-5.7.11-winx64\bin>mysqld --remove

    Service successfully removed.

    D:\myprogram\mysql-5.7.11-winx64\bin>mysqld --install

    Service successfully installed.

    D:\myprogram\mysql-5.7.11-winx64\bin>mysqld --initialize

    D:\myprogram\mysql-5.7.11-winx64\bin>net start mysql

    MySQL 服务正在启动 .

    MySQL 服务已经启动成功。

  5. 链接

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    net stop mysql

    [mysqld]这个条目下加入skip-grant-tables

    net start mysql

    mysql -u root -p

  6. 问题

    重改密码

    在5.7.9的mysql database的user表中没有password的字段了,更改为了authentication_string,所以修改root密码时使用

    mysql> update mysql.user set authentication_string=PASSWORD('root') where user='root';

        Query OK, 1 row affected, 1 warning (0.04 sec)

        Rows matched: 1  Changed: 1  Warnings: 1

        mysql> flush privileges;

        Query OK, 0 rows affected (0.00 sec)

        mysql> quit

        Bye

        C:\Windows\system32>mysql -u root -p

        Enter password: ****

        Welcome to the MySQL monitor.  Commands end with ; or \g.

        Your MySQL connection id is 3

        Server version: 5.7.11

        Copyright (c) 2000, 2016, 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 解压安装)