Green version MySQL installation configuration _mysql

Source: Internet
Author: User
Tags memory usage mysql client unique id win32
First, download MySQL
Http://www.mysql.org/downloads
I downloaded the mysql-noinstall-5.0.67-win32.zip.
Second, the installation process
1, decompression mysql-noinstall-5.0.67-win32.zip to a C disk, renamed to MySQL5 .
Suppose mysql_home=c:\ MySQL5
2, edit MySQL Run configuration file My.ini, if not, you can take My-medium.ini copy and then renamed to My.ini
Copy Code code as follows:

# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32m-64m) where MySQL plays
# an important part, or systems up to 128M where the MySQL is used together with
# Other programs (such as a Web server)
#
# You can copy this file to
#/ETC/MY.CNF to set global options,
# MYSQL-DATA-DIR/MY.CNF to set server-specific options
# Installation This directory is C:\mysql\data) or
# ~/.MY.CNF to set user-specific options.
#
# in this file, the can use the all long options supports.
# If you are want to know which options a program supports, run the program
# with the '--help ' option.

# The following options would be passed to all MySQL clients
[Client]
#password = Your_password
Port = 3306
Socket =/tmp/mysql.sock

# here follows entries for some specific programs

# The MySQL server
[Mysqld]
Basedir = "C:\MySQL5"
DataDir = "C:\MySQL5\data"
Default-character-set=utf8

Port = 3306
Socket =/tmp/mysql.sock
Skip-locking
Key_buffer = 16M
Max_allowed_packet = 1M
Table_cache = 64
Sort_buffer_size = 512K
Net_buffer_length = 8K
Read_buffer_size = 256K
Read_rnd_buffer_size = 512K
Myisam_sort_buffer_size = 8M

# Don ' t listen on a TCP/IP port at all. This can is a security enhancement,
# If all processes this need to connect to mysqld run on the same host.
# All interaction with Mysqld must is made via Unix sockets or named pipes.
# This is the using this option without enabling named Pipes on Windows
# (via the "enable-named-pipe" option) would render mysqld useless!
#
#skip-networking

# Disable Federated By default
skip-federated

# Replication Master Server (default)
# Binary logging is required for replication
Log-bin=mysql-bin

# required Unique ID between 1 and 2^32-1
# defaults to 1 if master-host are not set
# but would not function as a master if omitted
Server-id = 1

# Replication Slave (comment out master)
#
# To configure this host as a replication slave, can choose between
# Two methods:
#
# 1 Use the ' Change MASTER ' command (fully described in our manual)-
# The syntax is:
#
# change MASTER to Master_host=# master_user=<user>, master_password=<password>;
#
# where you replace # <port> by the master ' s port number (3306 by default).
#
# Example:
#
# change MASTER to master_host= ' 125.564.12.1 ', master_port=3306,
# master_user= ' Joe ', master_password= ' secret ';
#
# OR
#
# 2) Set the variables below. However, in the case for you choose this method, then
# Start replication for the ' even unsuccessfully, for example
# If you mistyped the password in Master-password and the slave fails to
# Connect), the slave'll create a master.info file, and any later
# change in this file to the variables ' values below'll be ignored and
# Overridden by the content of the Master.info file, unless you shutdown
# The slave server, delete master.info and restart the slaver server.
# for this reason, you'll want to leave the lines below untouched
# (commented) and instead use change MASTER to (= above)
#
# required Unique ID between 2 and 2^32-1
# (and different from the master)
# defaults to 2 if Master-host is set
# but would not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave-required
#master-host = #
# The username the slave would use for authentication when connecting
# to the master-required
#master-user = <username>
#
# The password the slave would authenticate with when connecting to
# The Master-required
#master-password = <password>
#
# The Port the master is listening on.
# Optional-defaults to 3306
#master-port = <port>
#
# binary Logging-not required for slaves, but recommended
#log-bin=mysql-bin

# Point the following paths to different dedicated disks
#tmpdir =/tmp/
#log-update =/path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = c:\mysql\data/
#innodb_data_file_path = Ibdata1:10m:autoextend
#innodb_log_group_home_dir = c:\mysql\data/
#innodb_log_arch_dir = c:\mysql\data/
# you can set ... _buffer_pool_size up to 50-80%
# of RAM But beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set ... _log_file_size to% of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[Mysqldump]
Quick
Max_allowed_packet = 16M

[MySQL]
No-auto-rehash
# Remove The next comment character if you are not familiar with SQL
#safe-updates

[Isamchk]
Key_buffer = 20M
Sort_buffer_size = 20M
Read_buffer = 2M
Write_buffer = 2M

[Myisamchk]
Key_buffer = 20M
Sort_buffer_size = 20M
Read_buffer = 2M
Write_buffer = 2M

[Mysqlhotcopy]
Interactive-timeout

[Mysqld]
# set the MySQL installation directory
basedir= $MYSQL _home
# set up the MySQL database data storage directory, must be either data, or \\xxx\data
datadir= $MYSQL _home\data
# set the character set of the MySQL server
Default-character-set=utf8

[Client]
# set the MySQL client's character set
Default-character-set=gbk

3. Install MySQL Service
From the MS-DOS window into the directory E:\myserver\mysql-5.0.37-win32\bin, run the following command:
Mysqld--install MySQL--defaults-file=c:\mysql5\my.ini

4. Start MySQL Database
Also in the command window above, enter the command: net start MySQL
This will start the MySQL service.

5. Stop Service
Execute net stop MySQL
6. Delete Service
Execute mysqld--remove MySQL

7, modify the password
After the installation is complete, the default root user password is empty. For security purposes, you need to set the password of a root user.
Copy Code code as follows:

<strong><span style= "color: #ffffff" style= "color: #ffffff" >c : \>CD mysql5  

c:\mysql5>cd bin  

c:\mysql5\bin>mysql-uroot-p   
Enter password:  
Welcome to the MySQL monitor.  Commands end With or \g.  
Your MySQL connection ID is 3  
Server version:5.0.67-community-log MySQL Community Edition (GPL) &N bsp; 

Type ' help, ' or ' \h ' for help. Type ' \c ' to clear the buffer.  

mysql> use mysql  
Database changed  
mysql> Update User set Password=password (' admin ') where user= ' root ';  
Query OK, 2 rows affected (0.08 sec)   
Rows matched:2  changed:2  warnings:0</span> 

</strong >
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.