MySQL5.7.20解凍版のインストール方法
3547 ワード
まず注意します:圧縮パッケージのルートディレクトリの下で手動でdataフォルダを創立しないでください、下のコードは自動的にwin 10のためにできるだけCディスクの下に詰めないでください、多くの権限の誤りが現れるかもしれません、例えばDディスクの下でソフトウェアフォルダを建てて、それからこのフォルダの中にインストールすることができて、次の例はwin 7の下で操作したので、あなたは相応のパスを修正するべきですC:Program FilesMySQLをD:softwareに変更
1.圧縮パッケージをC:Program FilesMySQLmysql-5.7.20-winx 64に解凍し、path環境変数を追加する:C:Program FilesMySQLmysql-5.7.20-winx 64;
2.目次のC:Program FilesMySQLmysql-5.7.20-winx 64新規my.ini、メモ帳が開き、コードが書き込まれます.
[client]
#no-beep
# pipe
# socket=mysql
port=3306
[mysql]
default-character-set=utf8
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
explicit_defaults_for_timestamp = TRUE
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 2G
# ,
basedir="C:\Program Files\mysql-5.7.26-winx64"
datadir="C:\Program Files\mysql-5.7.26-winx64\data\"
port=3306
server_id=1
# ,
#log-bin
#expire_logs_days=10 #
#max_binlog_size=100M # 100M
#
#general-log=0
#general_log_file="mysql_general.log"
#
#slow-query-log=1
#slow_query_log_file="mysql_slow_query.log"
#long_query_time=10
#
#log-error="mysql_error_log.err"
default-storage-engine=INNODB
max_connections=1024
#
query_cache_type=1
query_cache_size=128M
key_buffer_size=128M
innodb_flush_log_at_trx_commit=1
innodb_thread_concurrency=128
innodb_autoextend_increment=128M
tmp_table_size=128M
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
character-set-server=utf8
innodb_flush_method=normal
secure_file_priv=''
#my.ini
3.cmdに
cd C:\Program Files\MySQL\mysql-5.7.20-winx64\bin
を入力4.
mysqld --initialize-insecure
を入力これはパスワードなしrootユーザーログインです.このときcmdには何のヒントもありませんが、dataディレクトリは自動的に作成され、多くのフォルダとファイルが追加されています.エラーが発生した場合、cannote create directoryのエラーは、myを変更してください.iniプロファイルbasedir="C:/Program Files/MySQL/mysql-5.7.20-winx64/" #
datadir="C:/Program Files\MySQL/mysql-5.7.20-winx64/data/" #
# / \ ,cannote create directory
5.入力
mysqld -install
自己起動サービスのインストール6.入力
net start mysql
サービス開始7.
mysql -u root -p
空のパスワードを入力してログインする8.rootパスワードの変更
use mysql; Database changed
UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
Unknown column ‘password' ,
MySQL password authentication_string
update user set authentication_string=password('newpassword') where user=‘root';
flush privileges;
9.完了し、mysql自己起動サービスを手動で設定できます.そうしないと、起動時間に影響します.