Install and configure green mysql

Source: Internet
Author: User
Tags win32 window

1. Download MySQL
Http://www.mysql.org/downloadsWhat I download is mysql-noinstall-5.0.67-win32.zip.Ii. Installation Process
1. Extract Mysql-noinstall-5.0.67-win32.zip To a drive C, rename it MySQL5 .
Assume thatMYSQL_HOME = C :\ MySQL5 2, edit mysql running configuration file my. ini, if not, you can copy the my-medium.ini and then name My. ini 
Copy codeThe Code is as follows:
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32 M-64 M) where MySQL plays
# An important part, or systems up to 128 M where MySQL is used together
# Other programs (such as a web server)
#
# You can copy this file
#/Etc/my. cnf to set global options,
# Mysql-data-dir/my. cnf to set server-specific options (in this
# Installation this directory is C: \ mysql \ data) or
#~ /. My. cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# With the "-- help" option.

# The following options will 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 = 16 M
Max_allowed_packet = 1 M
Table_cache = 64
Sort_buffer_size = 512 K
Net_buffer_length = 8 K
Read_buffer_size = 256 K
Read_rnd_buffer_size = 512 K
Myisam_sort_buffer_size = 8 M

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# If all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (Via the "enable-named-pipe" option) will 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 is not set
# But will not function as a master if omitted
Server-id = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose
# Two methods:
#
#1) Use the change master to 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 = '192. 564.12.1 ', MASTER_PORT = 125,
# MASTER_USER = 'job', MASTER_PASSWORD = 'secret ';
#
# OR
#
#2) Set the variables below. However, in case you choose this method, then
# Start replication for the first time (even unsuccessfully, for example
# If you mistyped the password in master-password and the slave fails
# Connect), the slave will create a master.info file, and any later
# Change in this file to the variables 'values below will 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 that reason, you may want to leave the lines below untouched
# (Commented) and instead use change master to (see above)
#
# Required unique id between 2 and 2 ^ 32-1
# (And different from the master)
# Defaults to 2 if master-host is set
# But will not function as a slave if omitted
# Server-id = 2
#
# The replication master for this slave-required
# Master-host = #
# The username the slave will use for authentication when connecting
# To the master-required
# Master-user = <username>
#
# The password the slave will authenticate with when connecting
# 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 = 4 M
# Bdb_max_locked = 10000

# Uncomment the following if you are using InnoDB tables
# Innodb_data_home_dir = C: \ mysql \ data/
# Innodb_data_file_path = ibdata1: 10 M: 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 = 16 M
# Innodb_additional_mem_pool_size = 2 M
# Set .. _ log_file_size to 25% of buffer pool size
# Innodb_log_file_size = 5 M
# Innodb_log_buffer_size = 8 M
# Innodb_flush_log_at_trx_commit = 1
# Innodb_lock_wait_timeout = 50

[Mysqldump]
Quick
Max_allowed_packet = 16 M

[Mysql]
No-auto-rehash
# Remove the next comment character if you are not familiar with SQL
# Safe-updates

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

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

[Mysqlhotcopy]
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 the 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 the service.
Execute mysqld -- remove mysql.
7. Change the password
After the above installation is complete, the default root user password is blank. To ensure security, you need to set a password for the root user.Copy codeThe Code is 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)

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.