This article from: http://johnnyhg.javaeye.com/blog/245544
1. Download MySQL
Http://www.mysql.org/downloads I download is mysql-noinstall-5.0.67-win32.zip
Ii. Installation Process
1. Extract the mysql-noinstall-5.0.67-win32.zip to a C disk and rename it mysql5.
Assume mysql_home = C:/mysql5 2. Edit the MySQL running configuration file my. ini. If not, copy the my-medium.ini and name it my. ini. # Example MySQL config file for medium systems. <br/> # this is for a system with little memory (32 m-64 m) where MySQL plays <br/> # an important part, or systems up to 128 m where MySQL is used together with <br/> # other programs (such as a web server) <br/> # You can copy this file to <br/> #/etc/My. CNF to set global options, <br/> # mysql-data-DIR/My. CNF to set server-specific options (In this <br/> # installation this directory is C:/MySQL/data) or <br/> #~ /. My. CNF to set user-specific options. <br/> # in this file, you can use all long options that a program supports. <br/> # If you want to know which options a program supports, run the program <br/> # With the "-- Help" option. </P> <p> # The following options will be passed to all MySQL clients <br/> [client] <br/> # Password = your_password <br/> Port = 3306 <br/> socket =/tmp/MySQL. sock </P> <p> # Here fo Lows entries for some specific programs </P> <p> # the MySQL server <br/> [mysqld] <br/> basedir = "C: /mysql5 "<br/> datadir =" C: /mysql5/Data "<br/> default-character-set = utf8 </P> <p> Port = 3306 <br/> socket =/tmp/MySQL. sock <br/> skip-locking <br/> key_buffer = 16 m <br/> max_allowed_packet = 1 m <br/> table_cache = 64 <br/> sort_buffer_size = 512 K <br/> net_buffer_length = 8 K <br/> read_buffer_size = 256 k <br/> r Ead_rnd_buffer_size = 512 K <br/> myisam_sort_buffer_size = 8 m </P> <p> # Don't listen on a TCP/IP Port at all. this can be a security enhancement, <br/> # If all processes that need to connect to mysqld run on the same host. <br/> # all interaction with mysqld must be made via UNIX sockets or named pipes. <br/> # note that using this option without enabling Named Pipes on Windows <br/> # (via the "enable- Named-pipe "option) will render mysqld useless! <Br/> # Skip-networking </P> <p> # disable federated by default <br/> skip-federated </P> <p> # replication master server (default) <br/> # binary logging is required for replication <br/> log-bin = mysql-bin </P> <p> # required unique ID between 1 and 2 ^ 32- 1 <br/> # defaults to 1 if master-host is not set <br/> # but will not function as a master if omitted <br/> server-id = 1 </P> <p> # replication slave (comment out Master section to use this) <br/> # to configure this host as a replication slave, you can choose between <br/> # two methods: <br/> #1) use the change master to command (fully described in our manual)-<br/> # The syntax is: <br/> # change master to master_host = <post>, master_port = <port>, <br/> # master_user = <user>, master_password = <password >;< br/>#< br/> # Where you replace <post>, <user>, <password> by quoted strings and <br/> # <port> by the master's port number (3306 by default ). <br/> # example: <br/> # change master to master_host = '2017. 564.12.1 ', master_port = 3306, <br/> # master_user = 'job', master_password = 'secret '; <br/>#< br/> # or <br/> #2) set the variables below. however, in case you choose this method, then <br/> # Start replication for the first time (even unsuccessfully, for example <br/> # If you mistyped the password in master-password and the slave fails to <br/> # Connect), the slave will create a master.info file, and any later <br/> # change in this file to the variables 'values below will be ignored and <br/> # overridden by the content of the master.info file, unless you shutdown <br/> # The slave server, delete master.info and restart the slaver server. <br/> # For that reason, you may want to leave the lines below untouched <br/> # (commented) and instead use change master to (see above) <br/> # required unique ID between 2 and 2 ^ 32-1 <br/> # (and different from the master) <br/> # defaults to 2 if master-host is set <br/> # but will not function as a slave if omitted <br/> # server-id = 2 <br /># <br/> # The replication master for this slave-required <br/> # Master-host = <postname> <br/> # the username the slave will use for authentication when connecting <br/> # To the master-required <br/> # Master-user = <username> <br/> # the password the slave will authenticate with when connecting to <br/> # The Master-required <br/> # Master-Password = <password> <br/> # <br/> # The port the master is listening on. <br/> # optional-defaults to 3306 <br/> # Master-Port = <port> <br/> # binary logging-not required for slaves, but recommended <br/> # log-bin = mysql-bin </P> <p> # point the following paths to different dedicated disks <br/> # tmpdir =/tmp/ <br/> # log-update =/path-to-dedicated-directory/hostname </P> <p> # uncomment the following if you are using bdb tables <br/> # bdb_cache_size = 4 m <br/> # bdb_max_lock = 10000 </P> <p> # uncomment the following if you are using InnoDB tables <br/> # innodb_data_home_dir = C: /MySQL/data/<br/> # innodb_data_file_path = ibdata1: 10 m: autoextend <br/> # innodb_log_group_home_dir = C: /MySQL/data/<br/> # innodb_log_arch_dir = C:/MySQL/data/<br/> # You can set .. _ buffer_pool_size up to 50-80% <br/> # of Ram but beware of setting memory usage too high <br/> # innodb_buffer_pool_size = 16 m <br/> # bytes = 2 m <br/> # set .. _ log_file_size to 25% of buffer pool size <br/> # innodb_log_file_size = 5 m <br/> # innodb_log_buffer_size = 8 m <br/> # bytes = 1 <br/> # innodb_lockwait_timeout = 50 </P> <p> [mysqldump] <br/> quick <br/> max_allowed_packet = 16 m </P> <p> [MySQL] <br/> NO -Auto-rehash <br/> # Remove the next comment character if you are not familiar with SQL <br/> # Safe-Updates </P> <p> [isamchk] <br/> key_buffer = 20 m <br/> sort_buffer_size = 20 m <br/> read_buffer = 2 m <br/> write_buffer = 2 m </P> <p> [myisamchk] <br/> key_buffer = 20 m <br/> sort_buffer_size = 20 m <br/> read_buffer = 2 m <br/> write_buffer = 2 m </P> <p> [mysqlhotcopy] <br/> interactive-Timeout[Mysqld]
# Set the installation directory of MySQL
Basedir = $ mysql_home
# Set the data storage directory of the MySQL database, which must be data or // xxx/Data
Datadir = $ mysql_home/Data
# Set the character set of the MySQL server
Default-character-set = utf8
[Client]
# Set the character set of the mysql client
Default-character-set = GBK 3. Install the MySQL Service
Enter directory e:/myserver/MS-DOS/bin from the mysql-5.0.37-win32 window and run the following command:
Mysqld -- install MySQL -- defaults-file = C:/mysql5/My. ini 4. Start the MySQL database
In the above command window, enter the command: Net start MySQL
In this way, the MySQL service is started. 5. Stop the service
Execute net stop MySQL.
6. delete a service
Execute mysqld -- remove mysql. 7. After the installation is completed, the default root user password is blank. To ensure security, you need to set a password for the root user.<Strong> <span style = "color: # ffffff" mce_style = "color: # ffffff"> C:/> Cd mysql5 </P> <p> C: /mysql5> Cd bin </P> <p> C:/mysql5/bin> mysql-uroot-P <br/> enter password: <br/> welcome to the MySQL monitor. commands end with; or/g. <br/> your MySQL connection ID is 3 <br/> server version: 5.0.67-Community-log MySQL Community edition (GPL) </P> <p> type 'help; 'or'/H' for help. type '/C' to clear the buffer. </P> <p> mysql> use MySQL <br/> database changed <br/> mysql> Update user SET Password = PASSWORD ('admin ') where user = 'root'; <br/> query OK, 2 rows affected (0.08 Sec) <br/> rows matched: 2 changed: 2 Warnings: 0 </span> </P> <p> </strong>