MySQL Free install version script

Source: Internet
Author: User
Tags goto mysql free

Using MySQL often requires a free-to-install version (green version) of MySQL, began to search the Internet a lot, but it is not very useful.

Had to figure out their own, and now put out and share with you:

Install Startup services

[CPP]View PlainCopy
  1. @ECHO OFF
  2. If exist "%cd%/my.ini" goto startsrv
  3. for/f%%i in (' net start ') do if%%i==mysql goto mysql_isrunning
  4. Goto mysql_notrunning
  5. : mysql_isrunning
  6. echo "Found server!"
  7. net stop MySQL
  8. "%cd%"/bin/mysqld.exe-remove
  9. Goto Createmyini
  10. : mysql_notrunning
  11. echo "Not found!"
  12. : Createmyini
  13. REM-------------------------------------------------------
  14. REM Edit My.ini
  15. Setlocal enabledelayedexpansion
  16. Set realpath=
  17. Set replaced=/
  18. Set all=/
  19. for/f "delims="%%i in (' CD ') does (
  20. Set str=%%i
  21. Set "str=!str:%replaced%=%all%!"
  22. Set realpath=!str!
  23. )
  24. echo [Client] >>my.ini
  25. echo Default-character-set=utf8 >>my.ini
  26. Echo port=3306 >>my.ini
  27. echo [Server] >>my.ini
  28. echo Default-character-set=utf8 >>my.ini
  29. Echo port=3306 >>my.ini
  30. echo [MySQL] >>my.ini
  31. echo Default-character-set=utf8 >>my.ini
  32. echo [Mysqld] >>my.ini
  33. Echo port=3306 >>my.ini
  34. REM The following two sentences can be modified according to the actual situation
  35. Echo Basedir=%realpath%/>>my.ini
  36. Echo Datadir=%realpath%/data/>>my.ini
  37. echo Default-character-set=utf8 >>my.ini
  38. echo Default-storage-engine=innodb >>my.ini
  39. Echo max_connections=100 >>my.ini
  40. Echo query_cache_size=8m >>my.ini
  41. Echo table_cache=256 >>my.ini
  42. Echo tmp_table_size=9m >>my.ini
  43. Echo myisam_max_sort_file_size=100g >>my.ini
  44. Echo myisam_max_extra_sort_file_size=100g >>my.ini
  45. Echo myisam_sort_buffer_size=18m >>my.ini
  46. Echo key_buffer_size=11m >>my.ini
  47. Echo read_buffer_size=64k >>my.ini
  48. Echo read_rnd_buffer_size=256k >>my.ini
  49. Echo sort_buffer_size=256k >>my.ini
  50. Echo innodb_additional_mem_pool_size=2m >>my.ini
  51. Echo Innodb_flush_log_at_trx_commit=1 >>my.ini
  52. Echo innodb_log_buffer_size=1m >>my.ini
  53. Echo innodb_buffer_pool_size=18m >>my.ini
  54. Echo innodb_log_file_size=5m >>my.ini
  55. Echo innodb_thread_concurrency=8 >>my.ini
  56. REM Edit My.ini end.
  57. REM---------------------------------------------------------------
  58. "%cd%"/bin/mysqld.exe-install
  59. : startsrv
  60. net start MySQL
  61. Pause
  62. @ECHO on

Turn off Uninstall service

[CPP]View PlainCopy
    1. @ECHO off
    2. Set current_dir=%cd%
    3. Set mysql_home=%current_dir%
    4. net stop MySQL
    5. Bin/mysqld.exe-remove
    6. Del "%cd%"/my.ini

The key parts of the script are annotated, and if you have questions, you are welcome to discuss them together.

Also attach your own ready-to-install package (version 5.1.47), any version of the script is applicable

MySQL installation package (CSDN can not transfer large attachments, have to use this U egg, please carefully download)

If you already have the main file section, you can also put the bat file directly into the MySQL master directory

MySQL script. bat

http://blog.csdn.net/blpluto/article/details/5677457

MySQL Free install version script

Related Article

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.