zoukankan      html  css  js  c++  java
  • mysql 安装及设置

    mysql下载安装记录

    设备情况:win10,之前没有进行过mysql安装。
    一下载:直接官网下载,https://dev.mysql.com/downloads/file/?id=490026 下载的是解压版的。版本8.0.18 压缩包270M左右。下载完之后解压。

    二安装 : 参照 https://www.runoob.com/mysql/mysql-install.html 注意:cmd要用 【管理员权限】启动->在这里C:WindowsSystem32cmd.exe 然后运行到mysqld -install的时候
    下一步net start mysql 可能会出错:

    D:mysql-8.0.18-winx64in>net start mysql
    发生系统错误 193。

    *** 不是有效的 Win32 应用程序。

    这时候看这篇博客,原理好像是第一次默认安装在c盘,需要手动删除,然后remove一下,再次安装,就到你的指定的目录了。然后再net启动,就成功了

    https://blog.csdn.net/qq_35164169/article/details/77863600

    下面是我的安装过程;
    C:Windowssystem32>d:

    D:mysql-8.0.18-winx64in>mysqld install
    Service successfully installed.

    D:mysql-8.0.18-winx64in>net start mysql
    发生系统错误 193。

    *** 不是有效的 Win32 应用程序。


    D:mysql-8.0.18-winx64in>mysqld install
    The service already exists!
    The current server installed: C:Windowssystem32mysqld MySQL

    D:mysql-8.0.18-winx64in>c:

    C:WindowsSystem32>d:

    D:mysql-8.0.18-winx64in>mysqld remove
    Service successfully removed.

    D:mysql-8.0.18-winx64in>mysqld -install
    Service successfully installed.

    D:mysql-8.0.18-winx64in>mysqld -install
    The service already exists!
    The current server installed: D:mysql-8.0.18-winx64inmysqld MySQL

    D:mysql-8.0.18-winx64in>net start mysql
    MySQL 服务正在启动 .
    MySQL 服务已经启动成功。


    D:mysql-8.0.18-winx64in>mysql -u root -p
    Enter password: ************
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 8
    Server version: 8.0.18

    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>

    到这里就安装完成了,且完成了登录。


    cd D:mysql-8.0.18-winx64in

    Xkm?o-<aR4d=

    D:mysql-8.0.18-winx64in>
    D:mysql-8.0.18-winx64in>mysqld --initialize --console
    2019-10-28T00:52:20.344670Z 0 [System] [MY-013169] [Server] D:mysql-8.0.18-winx64inmysqld.exe (mysqld 8.0.18) initializing of server in progress as process 12956
    2019-10-28T00:52:21.724707Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Xkm?o-<aR4d=


    D:mysql-8.0.18-winx64in>mysqld --initialize --console
    2019-10-28T00:58:45.711083Z 0 [System] [MY-013169] [Server] D:mysql-8.0.18-winx64inmysqld.exe (mysqld 8.0.18) initializing of server in progress as process 1104
    2019-10-28T00:58:45.712542Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
    2019-10-28T00:58:45.712555Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:mysql-8.0.18-winx64data is unusable. You can remove all files that the server added to it.
    2019-10-28T00:58:45.718481Z 0 [ERROR] [MY-010119] [Server] Aborting
    2019-10-28T00:58:45.719322Z 0 [System] [MY-010910] [Server] D:mysql-8.0.18-winx64inmysqld.exe: Shutdown complete (mysqld 8.0.18) MySQL Community Server - GPL.

    # datadir=D:mysql-8.0.18-winx64

    //这个可以用 先创建用户,然后分配权限;%可以远程连接 修改后可以在workbench上登录
    CREATE USER 'zhangsan'@'%' IDENTIFIED BY '123456';
    GRANT ALL PRIVILEGES ON lskj.* TO 'zhangsan'@'%' WITH GRANT OPTION;
    FLUSH PRIVILEGES;


    //修改远程登录方法 可以在vs上使用。
    ALTER USER 'zhangsan'@'%' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
    ALTER USER 'zhangsan'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
    FLUSH PRIVILEGES;

  • 相关阅读:
    CSS3学习手记(7) CSS3装换 3D转换
    CSS3学习手记(6) CSS3装换 2D转换
    CSS3学习手记(5) 渐变
    CSS3学习手记(4) 伪元素
    CSS3学习手记(3) CSS权重
    CSS3学习手记(2) 伪类选择器
    CSS3学习手记(1) 选择器
    HTML5学习手记(二)
    HTML5学习手记(一)
    浏览器远程调试VS
  • 原文地址:https://www.cnblogs.com/67373cyf/p/12030633.html
Copyright © 2011-2022 走看看