Reproduced in http://blog.csdn.net/heizistudio/article/details/9916093
1. MySQL Community Server 5.6.10
Official website Download Mysql-5.6.10-winx64.zip
2, decompression to D:\MySQL. (path itself specified)
3, under the D:\MySQL new My.ini configuration file, the contents are as follows:
Configuration file Start *********************
# MySQL Server Instance Configuration File
#----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configurationwizard
#
#
# Installation Instructions
#----------------------------------------------------------------------
#
#
# CLIENT Section
#----------------------------------------------------------------------
#
# The following options would be a read by MySQL ClientApplications.
# Note that only client applications shipped by Mysqlare guaranteed
# to read the section. If you want your own mysqlclient
# Honor These values, you need to specify it as anoption during the
# MySQL Client library initialization.
#
[Client]
port=3306
[MySQL]
Default-character-set=gbk
# SERVER Section
#----------------------------------------------------------------------
#
# The following options would be read by the MySQL Server.make sure that
# You are installed the server correctly (see above) so it reads this
# file.
#
[Mysqld]
# The TCP/IP Port the MySQL Server would listen on
port=3306
#Path to installation directory. All paths is usuallyresolved relative to this.
Basedir= "D:\MySQL\"
#Path to the database root
Datadir= "D:\MySQL\Data"
[Winmysqladmin]
Server= "D:\MySQL\bin\mysqld.exe"
# The default character set that would be used if anew schema or table is
# created and no character set is defined
Default-character-set=gbk
# The default storage engine that would be is used whencreate new tables when
Default-storage-engine=innodb
# Set The SQL mode to strict
Sql-mode= "Strict_trans_tables,no_auto_create_user,no_engine_substitution"
# The maximum amount of concurrent sessions the MySQLServer would
# Allow. One of these connections is reserved fora user with
# SUPER privileges to allow the administrator to Logineven if the
# connection limit has been reached.
max_connections=100
# Query cache is used to cache SELECT results Andlater return them
# without actual executing the same query once again. Having the query
# cache enabled may result in significant speedimprovements, if your
# has a lot of identical queries and rarely changingtables. See the
# "Qcache_lowmem_prunes" status variable tocheck if the current value
# is high enough for your load.
# note:in Case your tables change very often or ifyour queries is
# textually different every time, the query cache Mayresult in a
# slowdown instead of a performance improvement.
Query_cache_size=0
# The number of open tables for all threads. Increasing this value
# increases the number of file descriptors that mysqldrequires.
# Therefore sure to set the amount Ofopen files
# allowed to @ least 4096 in the variable ' open-files-limit ' in
# section [Mysqld_safe]
table_cache=256
# Maximum size for internal (in-memory) temporarytables. If a table
# grows larger than this value, it's automaticallyconverted to disk
# based table This limitation are for a single table. There can many
# of them.
tmp_table_size=26m
# How many threads we should keep in a cache forreuse. When a client
# Disconnects, the client ' s threads is put in Thecache if there aren ' t
# More than Thread_cache_size threads Frombefore. This greatly reduces
# The amount of thread creations needed if you have alot of new
# connections. (Normally this doesn ' t give a notableperformance
# Improvement If you have a good threadimplementation.)
Thread_cache_size=8
#*** MyISAM Specific Options
# The maximum size of the temporary file MySQL isallowed to use while
# recreating the index (during REPAIR, ALTER TABLE orload DATA INFILE.
# If The file-size would is bigger than this, theindex'll be created
# through the key cache (which is slower).
myisam_max_sort_file_size=100g
# If The temporary file used for fast index creationwould is bigger
# than using the key cache by the amount specifiedhere and then prefer the
# Key Cache method. This is mainly used to force long character keys in
# Large tables to use the slower key cache method tocreate the index.
myisam_sort_buffer_size=52m
# Size of the Key Buffer, used to cache index blocksfor MyISAM tables.
# do not set it larger than 30% of your availablememory, as some memory
# is also required by the OS to cache rows. Even Ifyou ' re not using
# MyISAM tables, should still set it to 8-64m Asit would also be
# used for internal temporary disk tables.
key_buffer_size=40m
# Size of the buffer used for doing full table scansof MyISAM tables.
# Allocated per thread, if a full scan is needed.
read_buffer_size=64k
read_rnd_buffer_size=256k
# This buffer was allocated when MySQL needs to rebuildthe index in
# REPAIR, Optimze, ALTER table statements as well ASIN LOAD DATA INFILE
# into an empty table. It is allocated per thread SoBe careful with
# Large settings.
sort_buffer_size=256k
#*** INNODB Specific Options * * *
Innodb_data_home_dir= "D:\MySQL\Data\INNODB\"
# Use the This option if you had a MySQL server Withinnodb support enabled
# but don't plan to use it. This would save Memoryand disk space
# and speed up some things.
#skip-innodb
# Additional memory pool that's used by InnoDB Tostore metadata
# information. If InnoDB requires more memory for this purpose it would
# start to allocate it from the OS. As this is the fast enough on the most
# Recent operating systems, you normally don't needto change this
# value. SHOW INNODB STATUS would display the currentamount used.
Innodb_additional_mem_pool_size=2m
# If set to 1, InnoDB'll flush (fsync) thetransaction logs to the
# disk at each commit, which offers full acidbehavior. If you are
# Willing to compromise this safety, and you arerunning small
# transactions, you could set this to 0 or 2 to Reducedisk I/O to the
# logs. Value 0 means that the log was only written tothe log file and
# The log file flushed to disk approximately once persecond. Value 2
# means the log is written to the log file at Eachcommit, but the log
# file is a flushed to disk approximately once persecond.
Innodb_flush_log_at_trx_commit=1
# The size of the buffer InnoDB uses for buffering logdata. As soon as
# It's full, InnoDB'll has to flush it to disk. Asit is flushed
# once per second anyway, it does not make sense tohave it very large
# (even with long transactions).
innodb_log_buffer_size=1m
# InnoDB, unlike MyISAM, uses a buffer pool to cacheboth indexes and
# row data. The bigger you set this "less disk I/ois needed" to
# Access data in tables. On a dedicated databaseserver the set this
# parameter up to 80% of the machine physical memorysize. Do not set it
# too large, though, because competition of thephysical memory may
# cause paging in the operating system. Note that on 32bit systems
# might be limited to 2-3.5g of the user level memory perprocess
# Set it too high.
innodb_buffer_pool_size=77m
# Size of each log file in a log group. You should setthe combined size
# of log files to about 25%-100% of your buffer poolsize to avoid
# unneeded buffer pool flush activity on log fileoverwrite. However,
# Note that a larger logfile size would increase thetime needed for the
# recovery process.
innodb_log_file_size=39m
# Number of threads allowed inside the InnoDB kernel. The optimal value
# depends highly on the application, hardware as Wellas the OS
# Scheduler Properties. A too high value could lead tothread thrashing.
Innodb_thread_concurrency=8
Configuration file End *********************
The configuration file is also placed in the attachment, you can modify as needed.
The focus is on the following configuration, where the directory name of DataDir must be data and must be data in the MySQL directory. 1067 errors have been made in the previous directory.
#Path to installation directory. All paths is usuallyresolved relative to this.
Basedir= "D:\MySQL\"
#Path to the database root
Datadir= "D:\MySQL\Data"
4. Add the following to the Windows environment variable (easy to execute command line command)
New Mysql_home= "D:\MySQL\"
Add%mysql_home%\bin to Path
5. Register MySQL as a Windows system service. The specific action is to execute the following command on the command line:
Mysqld Install MySQL--defaults-file= "D:\MySQL\my.ini"
Remove Service for mysqld remove
6. After the 5th step succeeds, start MySQL at the command line
C:>net start MySQL
7. Change the root password to 62386997
method One:
C:>mysql–uroot
mysql>showdatabases;
Mysql>use MySQL;
mysql> UPDATE user SET Password=password ("62386997") whereuser= ' root ';
mysql> FLUSH privileges;
Mysql> QUIT
Method Two:
Modify with third-party management tools NAVICAT8 for MySQL
MySQL first use-How to troubleshoot MySQL "occurred system error 2, unable to find the specified file" issue (first time installation used)
1. Start the configuration file with Msyql, copy one out, and add the
[Mysqld] Added a
basedir=d:/mysql-5.1.6
Datadir=d:/mysql-5.1.6/data
Modify the name to My.ini and place it under Windows C.
Then cmd input: (Of course, first set in path to the bin directory of MySQL)
C:\Documents and Settings\bob>mysqld--install MySQL
Tip: Service successfully installed.
--》
C:\Documents and settings\bob>net start MySQL
Tips:
System error 2 has occurred.
The system cannot find the file specified.
2, after several trials and review the data should look like this:
1. Copy it according to the My-small.ini file and put it under Windows, the name is My.ini, and add
[Winmysqladmin]
Server=d:/mysql-5.1.6/bin/mysqld.exe
in [mysqld]
Find you a add:
basedir=d:/mysql-5.1.6
Datadir=d:/mysql-5.1.6/data
2. Then cmd goes to the appropriate directory, (the direct operation is not to go to the MSYQL directory, it will be installed by default to C:)
Msyqld--remove//Close Service
Mysqld-install//Start service
net start MySQL//Startup
Mysqlshow-u root MySQL//can view table
Mysql-u root-p//can log in as root
There is also a point that is not verified:
C:\Windows Directory priority >c packing directory >mysql directory, unless otherwise specified. This is in the default case.
(GO) Win7 64-bit under How to install configuration MySQL