日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

win7 安装mysql 5.7.9记录

發(fā)布時(shí)間:2024/4/17 数据库 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 win7 安装mysql 5.7.9记录 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.


--------------------------------------------------------------------------

1. 將配置文件my.ini配置好,放到c:/windows目錄下 (echo %windir%),然后執(zhí)行安裝mysql默認(rèn)數(shù)據(jù)庫的操作:


D:\tools\mysql-5.7.9-winx64\bin>mysqld --initialize-insecure --user=mysql


2. 將mysql安裝成windows中的服務(wù):

D:\tools\mysql-5.7.9-winx64\bin>mysqld install
Service successfully installed.

3. 然后在services.msc中啟動mysql服務(wù)。


4.允許root訪問,并且設(shè)置了root在192.168.0.101訪問過來的密碼,并且賦予root授予其他用戶權(quán)限的權(quán)利。(權(quán)限傳遞 使用這個(gè)子句時(shí)將允許用戶將其權(quán)限分配給他人)
mysql> grant all on *.* to "root"@"192.168.0.101" identified by "root"? WITH GRA
NT OPTION;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

5. 官方的windows安裝文檔:
http://dev.mysql.com/doc/refman/5.7/en/windows-troubleshooting.html? Troubleshooting a Microsoft Windows MySQL Server Installation
Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
http://dba.stackexchange.com/questions/24403/change-existing-datadir-path

?


###-------------my.ini----------------------######

####################配置文件開始###################

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the

# *** default location during install, and will be replaced if you

# *** upgrade to a newer version of MySQL.

[client]

default-character-set=utf8

?

[mysqld]

port=3306

basedir? ="D:/tools/mysql-5.7.9-winx64"

datadir? ="D:/tools/mysql-5.7.9-winx64/data"

tmpdir?? ="D:/tools/mysql-5.7.9-winx64/data"

socket?? ="D:/tools/mysql-5.7.9-winx64/mysql.sock"

log-error="D:/tools/mysql-5.7.9-winx64/data/mysql_error.log"

?

#server_id = 2

#skip-locking

?

max_connections=100

table_open_cache=256

query_cache_size=1M

?

tmp_table_size=32M

thread_cache_size=8

?
default-storage-engine=MYISAM
innodb_data_home_dir="D:/tools/mysql-5.7.9-winx64/data/"

innodb_flush_log_at_trx_commit =1

innodb_log_buffer_size=128M

innodb_buffer_pool_size=128M

innodb_log_file_size=10M

innodb_thread_concurrency=16

innodb-autoextend-increment=1000

join_buffer_size = 128M

sort_buffer_size = 32M

read_rnd_buffer_size = 32M

max_allowed_packet = 32M

explicit_defaults_for_timestamp=true

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

####################配置文件結(jié)束###################


########D:\tools\mysql-5.7.9-winx64\bin>mysqld? --defaults-file="D:\tools\mysql-5.7.9-winx64\my.ini" --console --skip-grant-tables#####################
###-------------my.ini end----------------------######

?

?


附:安裝過程中的日志、操作信息(備忘)

mysqld install MySQL --defaults-file="D:/tools/mysql-5.7.9-winx64/my.ini"

D:\tools\mysql-5.7.9-winx64\bin>mysqld? --defaults-file="D:\tools\mysql-5.7.9-winx64\my.ini" --console --skip-grant-tables

UPDATE user SET Password=PASSWORD("root") where USER="root";

mysql> UPDATE user SET Password=PASSWORD("root") where USER="root";
ERROR 1046 (3D000): No database selected
mysql> use information_schema;
Database changed
mysql> UPDATE user SET Password=PASSWORD("root") where USER="root";
ERROR 1109 (42S02): Unknown table 'user' in information_schema
mysql>

?

mysqladmin shutdown


http://dba.stackexchange.com/questions/24403/change-existing-datadir-path

http://www.cnblogs.com/lundy/archive/2010/05/07/1729510.html? https://bugs.mysql.com/bug.php?id=65413? Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist


http://dev.mysql.com/doc/refman/5.7/en/windows-troubleshooting.html? Troubleshooting a Microsoft Windows MySQL Server Installation


D:\tools\mysql-5.7.9-winx64\bin>mysqld --initialize-insecure --user=mysql
2015-11-12T15:34:20.701016Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'E
RROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will
be merged with strict mode in a future release.
2015-11-12T15:34:20.701016Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not s
et.
2015-11-12T15:34:20.709016Z 0 [ERROR] --initialize specified but the data direct
ory has files in it. Aborting.
2015-11-12T15:34:20.710016Z 0 [ERROR] Aborting

轉(zhuǎn)載于:https://www.cnblogs.com/justinzhang/p/4960668.html

總結(jié)

以上是生活随笔為你收集整理的win7 安装mysql 5.7.9记录的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。