MySQL Install-free version of the configuration steps detailed

Source: Internet
Author: User
Tags ini win32 mysql command line root directory

  This article mainly introduces the MySQL installation-free version of the configuration steps detailed, provided two users of the installation method, you can refer to the use of

1. Prepare work   Download MySQL's latest version of Mysql-noinstall-5.1.53-win32.zip, extract to the relevant directory, such as: D:mysql-noinstall-5.1.53-win32. This is the root directory of MySQL.   2. Configuration   There are several files in the root directory 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 more important part, or when the system reaches 128M, MySQL is used 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 1g–2g, the system mainly runs MySQL) my-innodb-heavy-4g.in I (this is an example of a MySQL profile for a 4G memory system (primarily running MySQL with only InnoDB tables and performing complex queries with several connections), and the other is deleted. Then rename into 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 #数据文件存放目录     3. Installation Services   CMD: access to the root directory of MySQL bin:mysqld--install MySQL has added a Windows service to the name by default MySQL. To remove the MySQL service: mysqld–remove MySQL settings service for automatic startup: sc config mysql start= auto   4. Startup and shutdown       code is as follows: Cmd:net Start MySQL--start net stop MySQL--close       MySQL startup. In the taskMysqld.exe This process can be seen in the 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 look. The root directory can leave only the My.ini and Bin,data,share directories, and all the rest is deleted. The bin directory allows you to delete all of the. pdb files.   6. Initializing database:   Because the MySQL default root password is empty and can only log on this machine, make the following modifications: cmd: Enter the root directory of MySQL Bin:mysql-uroot this time into the MySQL command line interface, continue to enter:     Code as follows: mysql< use MySQL; mysql< Delete from user; mysql< Grant all on *.* to root@ '% ' identified by ' root ' with GRANT option; mysql< flush Privileges; mysql< quit;    This gives the root user the initial password "root" and can not restrict native login.   7. Garbled problem:   Modify My.ini file, find [mysqld], add below:     code as follows: Character-set-server = UTF8 #mysql5.5 Start Default-ch Aracter-set = UTF8 #mysql5.5 before     Find [client], add below:       Code as follows: Default-character-set = UTF8 &nbs P   Another user to provide the installation steps and configuration files, you can refer to two methods   1. Unzip the Noinstall package to the location you want to put, this position can be put there all the time! It doesn't matter to reload 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:       Code as follows: [Client] Port=3306   [MySQL] default-character-set=gbk   [mysqld] port=3306 basedir= "E:/program files/mysql-5.1.58-win32 /"datadir=" E:/mysql datafiles/"DEFAULT-CHARACTER-SET=GBK default-storage-engine=innodb sql-mode=" STRICT_TRANS_ Tables,no_auto_create_user,no_engine_substitution "max_connections=100 query_cache_size=15m table_cache=256 Tmp_ table_size=18m thread_cache_size=8 myisam_max_sort_file_size=100g myisam_sort_buffer_size=35m Key_buffer_size=23M read_buffer_size=64k read_rnd_buffer_size=256k sort_buffer_size=256k innodb_data_home_dir= "E:/MySQL Datafiles/" innodb_additional_mem_pool_size=2m innodb_flush_log_at_trx_commit=1 innodb_log_buffer_size=1m Innodb_buffer_pool_ size=42m innodb_log_file_size=10m innodb_thread_concurrency=8       NOTE: There are datadir and Innodb_data_ to be modified here. Home_dir These two values, I have been set 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, and 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 was created in the previous step. --install followed by the service name appears: Services successfully installed. The service registration is successful.   4. Then: net start MySQL starts the MySQL service just registered. It's OK. If you want to delete this service. Use: mysqld--remove This command is the default to delete the name MySQL service, if not the name, in the remove after the corresponding service name.  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.