zoukankan      html  css  js  c++  java
  • Mysql8.0免安装包配置方法

    1. 官网下载mysql_8.0.12免安装包,解压到你存放的地方;

    https://www.jb51.net/softs/609101.html

    2. 配置环境变量(把bin的文件夹弄进系统path里面);

    3. 在解压的根路径中,查看是否含有my.ini文件,没有就新建一个,内容如下:

    [mysqld]
    # 设置3306端口
    port=3306
    # 设置mysql的安装目录
    basedir=E:Softwarelargemysqlmysql-8.0.12-winx64
    # 设置mysql数据库的数据的存放目录
    datadir=E:Softwarelargemysqlmysql-8.0.12-winx64data
    # 允许最大连接数
    max_connections=200
    # 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
    max_connect_errors=10
    # 服务端使用的字符集默认为UTF8
    character-set-server=utf8
    # 创建新表时将使用的默认存储引擎
    default-storage-engine=INNODB
    # 默认使用“mysql_native_password”插件认证
    default_authentication_plugin=mysql_native_password
    [mysql]
    # 设置mysql客户端默认字符集
    default-character-set=utf8
    [client]
    # 设置mysql客户端连接服务端时默认使用的端口
    port=3306
    default-character-set=utf8
    

    (ps:如果日志报无法找到data文件夹或者无法创建,那把路径的改为/, win10不用,win7就要改为/)!!!!!搞了半天才知道~~~这是个坑!!!)

    4. 在管理员的权限下进入cmd命令行,输入mysqld --initialize --console

    (作用是初始化数据库,把数据库的信息存在根路径下的data文件夹里面,并且生成随机密码。),出现下面的提示,其中红色标记的是数据库root用户的初始化密码,这时要记住,后面登陆需要用到。要是记不住,就删掉初始化的根目录下的data目录,在从新执行初始化命令。

    5. mysqld --install 进行mysql服务的安装

    6. 输入net start mysql启动服务

    7. 使用root用户与上面的密码进入的数据库mysql -uroot -p

    8. 修改root初始密码,要不然进行sql查询时,会提示1820错误,说必须要重设初始密码

    D:ProgramGreenmysql-8.0.16-winx64in>mysqld --initialize --console
    2020-01-17T11:23:23.650263Z 0 [System] [MY-013169] [Server] D:ProgramGreenmysq
    l-8.0.16-winx64inmysqld.exe (mysqld 8.0.16) initializing of server in progres
    s as process 8272
    2020-01-17T11:23:23.659264Z 0 [Warning] [MY-013242] [Server] --character-set-ser
    ver: 'utf8' is currently an alias for the character set UTF8MB3, but will be an
    alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to
     be unambiguous.
    2020-01-17T11:24:42.173755Z 5 [Note] [MY-010454] [Server] A temporary password i
    s generated for root@localhost: 【eEa3h!8_5%dK】#括号里即默认密码
    2020-01-17T11:25:10.701386Z 0 [System] [MY-013170] [Server] D:ProgramGreenmysq
    l-8.0.16-winx64inmysqld.exe (mysqld 8.0.16) initializing of server has comple
    ted
    
    D:ProgramGreenmysql-8.0.16-winx64in>mysqld --install
    Service successfully installed.
    
    D:ProgramGreenmysql-8.0.16-winx64in>net start mysql
    MySQL 服务正在启动 ........
    MySQL 服务无法启动。
    
    请键入 NET HELPMSG 3523 以获得更多的帮助。
    如果不成功,打开任务管理器,结束mysql相关进程即可
    
    D:ProgramGreenmysql-8.0.16-winx64in>net start mysql
    MySQL 服务正在启动 ....
    MySQL 服务已经启动成功。
    
    D:ProgramGreenmysql-8.0.16-winx64in>
    

    8.2 连接数据库,并修改默认密码set password='root';

    D:ProgramGreenmysql-8.0.16-winx64in>mysql -uroot -p
    Enter password: ************
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 9
    Server version: 8.0.16
    
    Copyright (c) 2000, 2019, 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> set password='root';
    Query OK, 0 rows affected (0.01 sec)
    
  • 相关阅读:
    flock对文件锁定读写操作的问题 简单
    hdu 2899 Strange Fuction(二分)
    hdu 2199 Can you solve this equation? (二分)
    poj 3080 Blue Jeans (KMP)
    poj 2823 Sliding Window (单调队列)
    poj 2001 Shortest Prefixes (trie)
    poj 2503 Babelfish (trie)
    poj 1936 All in All
    hdu 3507 Print Article (DP, Monotone Queue)
    fzu 1894 志愿者选拔 (单调队列)
  • 原文地址:https://www.cnblogs.com/chenxi188/p/12207271.html
Copyright © 2011-2022 走看看