Mysql.zip installation-free configuration mysql zip installation-free configuration
1. download MySQL select what you want. this installation. I am using a mysql-5.6.17-winx64
Address: http://dev.mysql.com/downloads/mysql/
2. decompress the zip file. find the my-default.ini in the root directory of mysql and copy a my. ini file, modify the my. ini file according to the location you need
A) append under [mysqld]
-------
Basedir = "d: // mysql"
Datadir = "d: // mysql // data"
Character-set-server = utf8
-------
B) append an object under [client]
-------
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# *** 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.[mysqld]# 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 = 128M# Remove leading # to turn on a very important data integrity option: logging# changes to the binary log between backups.# log_bin# These are commonly set, remove the # and set as required.# basedir = .....# datadir = .....# port = .....# server_id = ..... basedir =D:/work/mysql-5.6.17-winx64datadir =F:/db-data/mysqlcharacter-set-server = utf8 # 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 [client]default-character-set = utf8
3. start the service
Save
My. ini
And then open the command line to switch to the bin directory under the mysql decompression directory;
Run the mysqld.exe console Command to test
D:/work/mysql-5.6.17-winx64/bin>mysqld.exe console2014-04-22 19:11:09 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
Then run the mysqld.exe console command to start mysql.
D:/work/mysql-5.6.17-winx64/bin>mysqld.exe --console2014-04-22 19:11:33 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2014-04-22 19:11:33 5624 [Note] Plugin 'FEDERATED' is disabled.mysqld.exe: Table 'mysql.plugin' doesn't exist2014-04-22 19:11:33 5624 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.2014-04-22 19:11:33 5624 [Note] InnoDB: Using atomics to ref count buffer pool pages2014-04-22 19:11:33 5624 [Note] InnoDB: The InnoDB memory heap is disabled2014-04-22 19:11:33 5624 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions2014-04-22 19:11:33 5624 [Note] InnoDB: Compressed tables use zlib 1.2.32014-04-22 19:11:33 5624 [Note] InnoDB: Not using CPU crc32 instructions2014-04-22 19:11:33 5624 [Note] InnoDB: Initializing buffer pool, size = 128.0M2014-04-22 19:11:33 5624 [Note] InnoDB: Completed initialization of buffer pool2014-04-22 19:11:33 5624 [Note] InnoDB: Highest supported file format is Barracuda.2014-04-22 19:11:33 5624 [Note] InnoDB: 128 rollback segment(s) are active.2014-04-22 19:11:33 5624 [Note] InnoDB: Waiting for purge to start2014-04-22 19:11:33 5624 [Note] InnoDB: 5.6.17 started; log sequence number 16006072014-04-22 19:11:33 5624 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: dcd35109-ca0e-11e3-a872-003018a05bef.2014-04-22 19:11:33 5624 [Note] Server hostname (bind-address): '*'; port: 33062014-04-22 19:11:33 5624 [Note] IPv6 is available.2014-04-22 19:11:33 5624 [Note] - '::' resolves to '::';2014-04-22 19:11:33 5624 [Note] Server socket created on IP: '::'.2014-04-22 19:11:33 5624 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
Note: an exception occurs here: Table 'MySQL. user' doesn' t exist is because I don't have a data file and copied it to the path configured in my. ini,
The data file is the data directory under the mysql extract Directory. copy the content in the entire directory to the directory written in the configuration file, and then start
D:/work/mysql-5.6.17-winx64/bin>mysqld.exe --console2014-04-22 19:16:31 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2014-04-22 19:16:31 6180 [Note] Plugin 'FEDERATED' is disabled.2014-04-22 19:16:31 6180 [Note] InnoDB: Using atomics to ref count buffer pool pages2014-04-22 19:16:31 6180 [Note] InnoDB: The InnoDB memory heap is disabled2014-04-22 19:16:31 6180 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions2014-04-22 19:16:31 6180 [Note] InnoDB: Compressed tables use zlib 1.2.32014-04-22 19:16:31 6180 [Note] InnoDB: Not using CPU crc32 instructions2014-04-22 19:16:31 6180 [Note] InnoDB: Initializing buffer pool, size = 128.0M2014-04-22 19:16:31 6180 [Note] InnoDB: Completed initialization of buffer pool2014-04-22 19:16:32 6180 [Note] InnoDB: Highest supported file format is Barracuda.2014-04-22 19:16:32 6180 [Note] InnoDB: 128 rollback segment(s) are active.2014-04-22 19:16:32 6180 [Note] InnoDB: Waiting for purge to start2014-04-22 19:16:32 6180 [Note] InnoDB: 5.6.17 started; log sequence number 16259872014-04-22 19:16:32 6180 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 8f19129f-ca0f-11e3-a876-003018a05bef.2014-04-22 19:16:32 6180 [Note] Server hostname (bind-address): '*'; port: 33062014-04-22 19:16:32 6180 [Note] IPv6 is available.2014-04-22 19:16:32 6180 [Note] - '::' resolves to '::';2014-04-22 19:16:32 6180 [Note] Server socket created on IP: '::'.2014-04-22 19:16:32 6180 [Note] Event Scheduler: Loaded 0 events2014-04-22 19:16:32 6180 [Note] mysqld.exe: ready for connections.Version: '5.6.17' socket: '' port: 3306 MySQL Community Server (GPL)
Verify that mysql service has been started
6. set the password for logging on to the mysql root account
Open a new command line in the mysql/bin directory and press enter.
D:/work/mysql-5.6.17-winx64/bin>mysqlWelcome to the MySQL monitor. Commands end with ; or /g.Your MySQL connection id is 1Server version: 5.6.17 MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql>
The above similar content indicates that the login is successful. at this time, the root account does not have a password, and I do not intend to ask for a password.
To set the parameters, run the following command:
Directly run the command line window and enter the following
Mysqladmin-u root password
Your password
So OK,
7. install the mysql service
Run the command in the bin directory
mysqld.exe --install MySQL5.6.17 --defaults-file="D:/work/mysql-5.6.17-winx64/my.ini"
The result is as follows.
D:/work/mysql-5.6.17-winx64/bin>mysqld.exe --install MySQL5.6.17 --defaults-file="D:/work/mysql-5.6.17-winx64/my.ini"Service successfully installed.
8. start the service
net start MySQL5.6.17
D:/work/mysql-5.6.17-winx64/bin> net start MySQL5.6.17MySQL5.6.17 the service is starting. MySQL5.6.17 the service has been started successfully.
Note:If the registry cannot be modified, choose start> Run> regedit.
Find Services in HKEY_LOCAL_MECHINE---SYSTEM --- ControlSet001 or ControlSet002,
Change the ImagePath value to "D:/work/mysql-5.6.17-winx64/bin/mysqld" -- defaults-file = "D:/work/mysql-5.6.17-winx64/my. ini" MySQL
Finally, to facilitate the addition of environment variables.
MYSQL = D:/work/mysql-5.6.17-winx64
Path = % MYSQL %/bin; Path...
Test:
C:/Windows/System32>SET PATH=%MYSQL%/bin;%PATH%C:/Windows/System32>echo PATHPATHC:/Windows/System32>echo %PATH%D:/work/mysql-5.6.17-winx64/bin;D:/Program Files/java/jdk1.7.0_15/bin;D:/Program Files/java/jdk1.7.0_15/jre/bin;C:/Windows/system32;C:/Windows;C:/Windows/System32/Wbem;C:/Windows/System32/WindowsPowerShell/v1.0/C:/Windows/System32>mysqlWelcome to the MySQL monitor. Commands end with ; or /g.Your MySQL connection id is 2Server version: 5.6.17 MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql>
This ends.