当前位置:   article > 正文

win10系统安装MySQL5.7.30遇到的小坑,user表中不在有password字段而是authentication_string,my.ini文件中的路径写法遇坑问题_bin\share\errmsg.sys'. check error-message file lo

bin\share\errmsg.sys'. check error-message file location a

1. mysql 版本选择 

官方:https://dev.mysql.com/downloads/mysql/ 

严格按照截图的数字顺序选择 

到这里就下载完了。

 

2. 使用压缩包下载安装步骤

下面是my.ini内容:

  1. [client]
  2. # 设置mysql客户端默认字符集
  3. default-character-set=utf8
  4. [mysqld]
  5. # 设置3306端口
  6. port=3306
  7. character_set_server=utf8
  8. # 解压目录
  9. basedir=C:\\robotcoach\\mysql
  10. # 解压目录下data目录
  11. datadir=C:\\robotcoach\\mysql\\data
  12. default-storage-engine=INNODB
  13. sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
  14. [WinMySQLAdmin]
  15. C:\\robotcoach\\mysql\\bin\\mysqld.exe

备注:上面设计的xxxx\\data  ,这个data目录不是自己手动建好的,配置好一个目录就好,后面执行命令会自动建好该data目录!!!

my.ini配置完成以后,继续往下仔细看:

a:点击win图标,输入dos ,当出现cmd的黑色命令框时候,右击“以管理员身份运行”或者看到dos旁边有“以管理员身份运行”可以点击【win10系统是后者,其他不清楚】,一句话要用管理员身份运行dos窗口!,如下截图:

注意:如果不是管理员命令执行,会报错:Install/Remove of the Service Denied! 的提示错误。

b:打开cmd.exe,输入命令: mysqld -install:

 

  1. C:\Windows\system32>mysqld -install
  2. Service successfully installed.
  3. //以下是错误的演示,因为前面的图中每个路径用的单个\,而非\\ 的原因
  4. C:\Windows\system32> mysqld --initialize-insecure --user=mysql
  5. [0x7FFF1B1EE044] ANOMAL Y: use of REX.w is meaningless (default operand size is 64)
  6. obotcoach\mysql\data\is_writable' (Errcode: 2 - No such file or directory)
  7. 2021-03-04T08:29:14.011250Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
  8. 2021-03-04T08:29:14.011299Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
  9. 2021-03-04T08:29:14.011303Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
  10. obotcoach\mysql\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
  11. 2021-03-04T08:29:14.014800Z 0 [ERROR] --initialize specified but the data directory exists and is not writable. Aborting.
  12. 2021-03-04T08:29:14.015198Z 0 [ERROR] Aborting
  13. //将\ 改成\\以后重试命令,不在报错,出现ok

c:  C:\Windows\system32>mysqld --initialize-insecure --user=mysql   有几秒的间隔,不报错就是表示初始化成功,执行完这条命令,这时mysql就帮你自己创建一个data文件夹。

到这里 mysql的win10版本就安装ok了。

3.navicat premium 链接 mysql 完美测试

安装完mysql,启动操作下如图:

  1. C:\Windows\system32>net start mysql
  2. [0x7FFF1B1EE044] ANOMALY: use of REX.w is meaningless (default operand size is 64)
  3. [0x7FFF1B1EE044] ANOMALY: use of REX.w is meaningless (default operand size is 64)
  4. MySQL 服务正在启动 .
  5. MySQL 服务已经启动成功。
  6. C:\Windows\system32>net stop mysql
  7. [0x7FFF1B1EE044] ANOMALY: use of REX.w is meaningless (default operand size is 64)
  8. [0x7FFF1B1EE044] ANOMALY: use of REX.w is meaningless (default operand size is 64)
  9. MySQL 服务正在停止.
  10. MySQL 服务已成功停止。
  11. C:\Windows\system32>services.msc ##这里可以不操作,只是看一下相关mysql服务通过cmd的命令执
  12. ## 行情况.
  13. C:\Windows\system32>net start mysql
  14. [0x7FFF1B1EE044] ANOMALY: use of REX.w is meaningless (default operand size is 64)
  15. [0x7FFF1B1EE044] ANOMALY: use of REX.w is meaningless (default operand size is 64)
  16. MySQL 服务正在启动 .
  17. MySQL 服务已经启动成功。
  18. C:\Windows\system32>mysql -uroot ##我这里不知道初始化的密码是什么,所以我打算想办法进入到库
  19. ##表中,更改密码等操作
  20. [0x7FFF1B1EE044] ANOMALY: use of REX.w is meaningless (default operand size is 64)
  21. Welcome to the MySQL monitor. Commands end with ; or \g.
  22. Your MySQL connection id is 6
  23. Server version: 5.7.30 MySQL Community Server (GPL)
  24. Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
  25. Oracle is a registered trademark of Oracle Corporation and/or its
  26. affiliates. Other names may be trademarks of their respective
  27. owners.
  28. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  29. mysql> show databases;
  30. +--------------------+
  31. | Database |
  32. +--------------------+
  33. | information_schema |
  34. | mysql |
  35. | performance_schema |
  36. | sys |
  37. +--------------------+
  38. 4 rows in set (0.00 sec)
  39. mysql> use mysql
  40. Database changed
  41. mysql> show tables;
  42. +---------------------------+
  43. | Tables_in_mysql |
  44. +---------------------------+
  45. | columns_priv |
  46. | db |
  47. | engine_cost |
  48. | event |
  49. | func |
  50. | general_log |
  51. | gtid_executed |
  52. | help_category |
  53. | help_keyword |
  54. | help_relation |
  55. | help_topic |
  56. | innodb_index_stats |
  57. | innodb_table_stats |
  58. | ndb_binlog_index |
  59. | plugin |
  60. | proc |
  61. | procs_priv |
  62. | proxies_priv |
  63. | server_cost |
  64. | servers |
  65. | slave_master_info |
  66. | slave_relay_log_info |
  67. | slave_worker_info |
  68. | slow_log |
  69. | tables_priv |
  70. | time_zone |
  71. | time_zone_leap_second |
  72. | time_zone_name |
  73. | time_zone_transition |
  74. | time_zone_transition_type |
  75. | user |
  76. +---------------------------+
  77. 31 rows in set (0.00 sec)
  78. mysql> select user,host ,authentication_string from user ;
  79. +---------------+-----------+-------------------------------------------+
  80. | user | host | authentication_string |
  81. +---------------+-----------+-------------------------------------------+
  82. | root | localhost | |
  83. | mysql.session | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
  84. | mysql.sys | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
  85. +---------------+-----------+-------------------------------------------+
  86. 3 rows in set (0.00 sec)
  87. mysql> select user,host ,password from user ; ##5.7.xx版本没有password这个字段了,改为
  88. ## authentication_string
  89. ERROR 1054 (42S22): Unknown column 'password' in 'field list'
  90. mysql> use mysql
  91. Database changed
  92. mysql> update user set authentication_string=password("123456") where user="root"; ##修改
  93. Query OK, 0 rows affected, 1 warning (0.00 sec)
  94. Rows matched: 1 Changed: 0 Warnings: 1
  95. mysql> flush privileges; ##必须flush 不然不刷新直接退出 仍然下次登陆不了!
  96. Query OK, 0 rows affected (0.00 sec)
  97. mysql> quit
  98. Bye
  99. C:\Windows\system32>mysql -uroot -p123456
  100. [0x7FFF1B1EE044] ANOMALY: use of REX.w is meaningless (default operand size is 64)
  101. mysql: [Warning] Using a password on the command line interface can be insecure.
  102. Welcome to the MySQL monitor. Commands end with ; or \g.
  103. Your MySQL connection id is 9
  104. Server version: 5.7.30 MySQL Community Server (GPL)
  105. Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
  106. Oracle is a registered trademark of Oracle Corporation and/or its
  107. affiliates. Other names may be trademarks of their respective
  108. owners.
  109. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  110. mysql> show databases;
  111. +--------------------+
  112. | Database |
  113. +--------------------+
  114. | information_schema |
  115. | mysql |
  116. | performance_schema |
  117. | sys |
  118. +--------------------+
  119. 4 rows in set (0.00 sec)
  120. mysql>

注意:mysql> update user set authentication_string=password("123456") where user="root"; ##修改语句,其中 authentication_string不在是password字段,且后边紧跟着 flush privileges;   ##必须flush  不然不刷新直接退出  仍然下次登陆不了!

使用navicat  premium链接如图:

4 .总结

遇到问题不是盲目查找帖子的,系统梳理步骤和顺序,可能自己就能解决,最后:问题不大,win10笔记本安装,其实遇到的小坑就是\\的问题,其他都很简单,记录下来防止过多的看帖子。不要眼高手低,因为笔记本是新装的系统,没成想安装一遍mysql还遇到了一个小坑。仅此。

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/217167
推荐阅读
相关标签
  

闽ICP备14008679号