1. Preparatory work
Download MySQL's latest free install version mysql-noinstall-5.1.53-win32.zip, unzip to the relevant directory, such as: D:\ Mysql-noinstall-5.1.53-win32. This is the root directory of MySQL.
---------------------------------------------------------------------------------------------
2. Configuration
In the root directory there are several files as follows:
My-small.ini (This is for a small memory (〈= 64MB) system, MySQL will only be used from time to time, it is important that the mysqld daemon does not use a lot of resources. My-medium.ini (This is for a small memory (32m-64m) system, MySQL plays a relatively important part, or when the system reaches 128M, MySQL is used in conjunction with other programs, such as a WEB server. My-large.ini (This is for a large system of memory = 512M, the system mainly runs MySQL) My-huge.ini (this is for a large system of memory for 1G–2G, the system mainly runs MySQL) My-innodb-heavy-4g.ini ( This is an example of a MySQL configuration file for a 4G memory system (mainly running MySQL with only InnoDB tables and using several connections to perform complex queries). Then rename it to My.ini. Edit My.ini, add the following sentence under the [mysqld] node: basedir= d:/mysql-noinstall-5.1.53-win32 #根目录datadir = D:/mysql-noinstall-5.1.53-win32 /data #数据文件存放目录
----------------------------------------
Open the Windows environment variable setting, new variable name mysql_home, the variable value is the MYSQL installation directory path, here is C:\Program Files\mysql-5.1.69-win32
Add to the Path variable of the environment variable ;%mysql_home%\bin;
--------------------------------
3. Installation Services
CMD: Enter MySQL root directory in:mysqld--install MySQL This adds a Windows service to the name with the default MySQL. To remove the MySQL service: mysqld–remove mysql setup service for auto start: sc config mysql start= auto
----------------------------------------------------------------------------------------------------
4. Start and close
Copy the code code as follows:
Cmd:net start MySQL--startup net stop MySQL--close
After MySQL starts. The Mysqld.exe process can be seen in the task manager. This means that MySQL is already installed. and has been successfully launched!
--------------------------------------------------------------------------------------------------------------- -
5. Streamlining:
If you think the MySQL directory is too large, please see. The root directory can only leave the My.ini and Bin,data,share directories, and all the rest are deleted. The. pdb file can be removed from the bin directory.
--------------------------------------------------------------------------------------------------------------- --------------------------------
6. Initialize the database:
Since MySQL default root password is empty and can only log on, make the following changes: cmd: Into the root directory of MySQL In:mysql-uroot then entered the MySQL command line interface, continue to enter:
Copy the code code as follows:
mysql< use mysql;mysql< Delete from user;mysql< grant all on * * to [e-mail protected] '% ' identified by ' root ' wit H Grant option;mysql< flush privileges;mysql< quit;
This gives the root user the initial password "root" and can not restrict native logons.
=======================================================================
7. Garbled problem:
Modify the My.ini file to find [mysqld] and add the following below:
Copy the code code as follows:
Character-set-server = UTF8 #mysql5.5 Start Default-character-set = UTF8 #mysql5.5 ago
Find [client] and add it below:
Copy the code code as follows:
Default-character-set = UTF8
Another user to provide the installation steps and configuration files, you can refer to two methods 1. Unzip the downloaded Noinstall package to the location you want to place, this position can be put there! It doesn't matter if you re-install the system later. I am here: E:/program FILES/MYSQL-5.1.58-WIN32/2. Create a new My.ini file. This is the MySQL configuration file, can also be renamed from the original INI, but now you can directly copy the following configuration:
Copy the code code as follows:
[client]port=3306
[MYSQL]DEFAULT-CHARACTER-SET=GBK
[mysqld]port=3306basedir= "E:/program files/mysql-5.1.58-win32/" datadir= "E:/mysql Datafiles/" Default-character-set=gbkdefault-storage-engine=innodbsql-mode= "Strict_trans_tables,no_auto_create_user,no_ Engine_substitution "max_connections=100query_cache_size=15mtable_cache=256tmp_table_size=18mthread_cache_size= 8myisam_max_sort_file_size=100gmyisam_sort_buffer_size=35mkey_buffer_size=23mread_buffer_size=64kread_rnd_ Buffer_size=256ksort_buffer_size=256kinnodb_data_home_dir= "E:/mysql datafiles/" innodb_additional_mem_pool_size= 2minnodb_flush_log_at_trx_commit=1innodb_log_buffer_size=1minnodb_buffer_pool_size=42minnodb_log_file_size= 10minnodb_thread_concurrency=8
Note: The two values that need to be modified here are DataDir and Innodb_data_home_dir, which I have been setting to the same folder. Innodb_data_home_dir is the data address of the INNODB database storage engine.
3. Use CMD to enter the bin directory under the MySQL installation directory, then execute: mysqld--install mysql--defaults-file= "E:program Filesmysql-5.1.58-win32my.ini" is to register as a system service. The default configuration file that follows is the path to the file that you created in the previous step. --install followed by the name of the service appears: Services successfully installed. The service registration was successful.
4. Then: net start MySQL to start the MySQL service just registered. It's OK. If you want to delete this service. Use: mysqld--remove This command is the default to remove the service named MySQL, if not the name, add the corresponding service name after remove.
MySQL in the WIN System DOS installation version of the configuration steps detailed