How to install MySQL in windows (1)

Source: Internet
Author: User


MySQL database programs that can run in the local windows version can be obtained from MySQL AB since MYSQL 3.21, and the percentage of MySQL downloads per day is very large. this section describes how to install MySQL on windows. the installer is for MySQL 5.0 of windows version. It combines the graphical Installation Wizard to automatically install MySQL, create a configuration file, start the server, and protect the default user account. if you are upgrading and installing the existing MySQL 4.1.5 version. you must complete the following steps:

Get and install
2. If necessary, install the configuration file
3. Select a server you want to use.
4. Start the server
5. Set a password for the MYSQL account.
This process is completed in the myslq installer without the installation configuration.
Available formats for MySQL 5.0 for Windows:
The binary installer can install everything you need in order. You can start the server immediately.
The original class includes all code and supporting files built and executed using the Visual Studio 2003 compilation system.

Generally, you should use the binary format. it is simpler than others, and you do not need additional tools for mysql to use and run. this document describes how to install MYSQL in binary format on windows.
1. To run MYSQL on WINDOWS, you must meet the following conditions:
· A 32-bit WINDOWS operating system, 9x, ME, NT, 2000, XP, or windows server2003. Based on windows nt Operating System (NT, 2000, XP, 2003) allows you to run a MYSQL server as a service. we strongly recommend that you use windows nt-based operating systems.
· TCP/IP protocol supports. · MYSQL for windows in binary version, which can be downloaded from http://dev.mysql.com/downloads. Note: If you download through FTP, we recommend that you use appropriate FTP software. It is important to avoid file corruption during the current process ..
· A tool that can open the. ZIP file to open the Installation File
· It is recommended that the disk space be at least 200 M. If you are going to connect to MYSQL through ODBC, you also need to connect to the driver through ODBC
· You need more than 4 GB tables, install MYSQL on NTFS or the new file system. When you create a table, do not forget to use MAX-ROWS and AVG_ROW_LENGTH.
2. Select an installation component
For MYSQL 5.0, there are three components used to install MYSQL on WINDOWS. The following are the components:
· Basic components: this component has a similar mysql-essential-5.0.13-rc-win32.msi and contains the smallest requirement file components that do not contain optional components and included server and benchmark Components
· All components: this component has a file name similar to the mysql-5.0.13-rc-win32.zip and contains all the required files to complete WINDOWS installation. Including the Configuration Wizard. This component includes optional components and included server and benchmark Components
· No installation archive :. this group contains the file name for mysql-noinstall-5.0.13-rc-win32.zip and the file for creating and installing the component. except for the Configuration Wizard. this component does not contain automatic installation and must be manually installed and configured. most of them recommend basic components.
3. Use the Configuration Wizard
The MySQL Configuration Wizard can help you automatically configure servers in WINDOWS. The MySQL Configuration Wizard will first create a custom my based on a series of issues. INI file, and then according to the content filled in and apply it to the template to generate a compatible with the installation of my. INI file. The Configuration Wizard is included in the MySQL 5.0 server and is now only applicable to WINDOWS users. The Configuration Wizard is largely based on the user feedback on My SQL AB in recent years. If you think the wizard content lacks the important content you need, or if you find an error, please use the MySQL error reporting system to add new features or report error information.
After installation, you can directly enter the Configuration Wizard or click the MySQL server instance wizard in the WINDOWS Start Program to enter the MySQL Configuration Wizard. Alternatively, you can find the mysqlinstanceconfig.exe file in the bindirectory under the mysqlinstallation directory and run it directly.
If your MySQL Configuration Wizard finds an existing my. INI file. You can reconfigure an existing server or delete my. INI file, stop and remove the MySQL service to remove the server instance. To reconfigure an existing Server, select the "reconfigure instance" option and select the "Next" button. The existing my. ini file is renamed as mytimestamp. ini. bak. The timestamp is the date and time when the existing my. ini file was created. Remove an existing database instance, select the "Remove instance" option, and select the "Next" button. If the "Remove instance" option is selected, the confirmation page is displayed. Click "run". The MySQL Configuration Wizard stops and begins to remove MySQL services and deletes the my. ini file. However, the Server installation directory is not removed. If you select the "reconfigure instance" option to go to the "configuration type" interface, you can select the installation type you want to configure.
If you select "Install MySQL" or "reconfigure instance" in the MySQL Configuration Wizard, two configuration types are available on the "configuration type" Page: detailed configuration and standard configuration. The standard configuration options are designed for beginners who do not need to consider complex server configurations. Detailed configuration options are used by advanced users who can operate the server better. If you are using MySQL as a single-user development machine, the standard configuration can meet your needs. After you select the standard configuration, the Configuration Wizard automatically configures other parts except the service options and security options. If MySQL has been installed on your machine, the standard configuration may not be suitable for your system. The "detailed configuration" option is recommended for further configuration.
Then, enter the server type page. There are three different server types to choose from. After selecting the server type, the Configuration Wizard will determine the memory, disk, and processor usage based on the selected differences.
• Developer Edition: This option is a typical desktop workstation designed for personal use by MySQL. There are many other desktop applications that can also run here. The MySQL server uses the smallest system resource.
• Server version: with this option selected, MySQL can run simultaneously with other server applications such as FTP, email, and Web services. The MySQL server configuration uses a moderate level of system resources.
• MySQL Server Professional Edition: This option can only run MySQL servers, but cannot run other applications. The MySQL server configuration uses all available resources.
The "database use" interface allows you to specify the table operation you want to use when creating a MySQL table. The selection determines whether the InnoDB Storage engine is available and the percentage of system resources that InnoDB can use. Multi-functional database: This option is available for the InnoDB and MyISAM storage engines, and resources are evenly allocated between the two. We recommend that you use these two storage engines. Transaction-type Database: This option can be used by both the InnoDB and MyISAM storage engines, but it is more likely that the system's major department resources are used by the InnoDB Storage engine. We recommend that you use InnoDB frequently and seldom use MyISAM.
• Non-transactional database: This option completely disables the InnoDB Storage engine and focuses entirely on the MyISAM storage engine. We recommend that you do not use InnoDB.
InnoDB tablespace Interface
Some users prefer to place InnoDB tablespace files in different locations rather than MySQL Server Data Directories. If the system has higher storage capabilities or higher-performance storage devices available, such as RAID storage systems, you can place tablespace files in different locations. You can modify the default location of the InnoDB tablespace file and select a new path from the drive letter list in the drop-down list box. Create a custom path and click "...". If you modify an existing server configuration, you must click the modify button before modifying the path. Before starting the server, you must manually move the existing tablespace files to a new location.
Concurrent connection interface
Controlling the number of concurrent connections to the MySQL server can effectively prevent consumption of system resources. The concurrent connection interface allows you to select the server as per your needs and set concurrent connection restrictions. You can also manually set the number of concurrent connections.
• Decision Support DSS)/OLAP): This option is selected when the server does not require a large number of concurrent connections. The maximum number of connections can reach 100, but there are 20 concurrent connections on average.
• Online Transaction Processing (OLTP): This option is selected when the server requires a large number of concurrent connections. The maximum number of connections can be up to 500.
• Manual setting: You can select this option to manually set the maximum number of trees for concurrent access to the server. Select the maximum number of connections from the drop-down list box. You can manually enter the maximum number of connections.
Network Configuration option dialog box
You can use the network configuration dialog box to activate or disable the TCP/IP network service to configure the port number connected to the MySQL server at the same time. The TCP/IP network service is activated by default. In Windows, you can disable the TCP/IP network service by selecting the option box without selecting the TCP/IP network option. The default port is 3306. To change the port used to access MySQL, select a new port number from the drop-down list or enter a new port number in the option box. If the selected port number has been used, the system will prompt you to confirm the selection of the port number.
Font Setting Dialog Box
MySQL Server supports multi-font setting and can set the default service font for the server. This font can be applied to all data tables, columns, and databases that are not under super control. You can use the font Settings dialog box to change the default font settings of the MySQL server.
1 Standard font setting: This option is used to use Latin1 as the default service font. Latin1 can be used for English and many Spanish fonts.
2. optimal support for multilingual fonts: UTF8 is used as the default service font. In a single font setting, UTF8 can store fonts from many different languages.
3. manually select default character settings/sorting: This option is used to manually set the default font. You can select the desired characters from the font in the drop-down box.
Service Selection dialog box
On a Windows NT-based platform, the MySQL server can be installed as a Windows service. When the MySQL server is installed as a service, it can start as the system starts, and when the service fails, the MySQL server can automatically restart. In the default configuration of MySQL, the MySQL server is installed as a service and the service name is MySQL. If you do not want to install this service, you can choose not to use it as a Windows Service Selection box. You can select a new service name from the drop-down box or enter a new service name in the drop-down box. If you need to install the MySQL server as a service and make MySQL not start as the system starts, you do not select the Mysql server selection box.
Security selection dialog box
We strongly recommend that you set a corresponding root user password for your MySQL server, and you need to set a default root user password for the MySQL Configuration Wizard. If you do not want to set the root user password, do not select the security setting option. To set the root user password, you must enter the new root user password and confirm the selection box. If you need to reconfigure an existing server, you need to enter its root user password into the current Root Password selection box. To prevent the Root user from logging on through the network, you can set it to allow only local connections in the Root selection box. This will enhance the security of your root users. To generate an anonymous user account, select the generate anonymous account option box. Generating an anonymous user account may reduce server security and cause logon and authentication difficulties. For this reason, this option is generally not recommended.
Confirmation dialog box
The final dialog box in the MySQL Configuration Wizard is the confirmation dialog box. You can click "execute" to start the configuration operation. To return to the previous dialog box, click "back. You can click "cancel" to exit the MySQL Configuration Wizard without configuring the server. When you click the "execute" button without configuring the server, the MySQL Configuration Wizard executes a series of tasks. When the task is executed, the progress will be displayed on the screen. The MySQL Configuration Wizard first uses the template configuration file prepared by MySQL AB developers and engineers to determine the configuration file options based on your selection. The template is named my-template.ini and located under your service period installation directory. The MySQL Configuration Wizard writes these options to the my. ini file. The final position of the my. ini file will be displayed in the write configuration file task. If you choose to generate a service for the MySQL server, the MySQL Configuration Wizard will generate and start the service. If you are re-configuring an existing service, the MySQL service Wizard will restart the service to re-apply the changed configuration. If you choose to set a root password, the MySQL Configuration Wizard will connect to the server, set your new root user password and apply other security settings you have selected. After the MySQL Configuration Wizard completes its tasks, a summary is displayed. Click "end" to exit the MySQL Configuration Wizard.
Location of my. ini configuration file
The MySQL Configuration Wizard places the my. ini file in the installation directory of the MySQL server. This will help associate the configuration file with a specific server instance. To ensure that the MySQL server knows where to find my. INI file. Parameters similar to the following content will be passed to the MySQL server as part of the service installation: -- defaults-file = "C: \ Program Files \ MySQL Server 5.0 \ my. ini C: \ Program Files \ MySQL Server 5.0 can be replaced by the installation path pointing to the MySQL Server.
Edit the my. ini file
You can use a text editor to open the file and make necessary edits and modifications. You can also modify the server configuration using the MySQL Administrator application. The MySQL client and application, such as the mysql command line client and mysqldump, cannot determine the location of the my. ini file in the Server installation directory. To configure the client and application, generate a new file my. ini in C: \ Windows or in the C: \ WINNT directory based on your Windows version.

4. Install MySQL from Noinstall Zip Archive
Users who are installing MySQL from the Noinstall package can use this instruction to manually install MySQL. Follow these steps to install MySQL from Zip archive:

1 Extract the package in the specified installation directory.
   2 Manufacturing selection file.
   3 Select the MySQL service type.
   4 Start the MySQL service.
Decompress the installation package
To manually install MySQL, follow these steps:
1. If you need to update a previous version, refer to the article "Upgrading MySQL on Windows" at the beginning of the update step ".
2. If you are using Windows NT-based operating systems such as Windows NT, Windows 2000, Windows XP, or Windows Server 2003, you must ensure that you log on to the system as a user with administrator privileges.
3. Select an installation location. The traditional MySQL server is installed in C: \ mysql, while the MySQL Installation Wizard installs MySQL in C: \ Program Files \ MySQL. If you do not install MySQL under C: \ mysql, you must specify the installation path in the startup or selection file.
4. Use a compression tool to decompress the installation software to the selected installation location. Some compression tools may decompress it to the subdirectory of your selected installation location. In this case, you can move the contents of this subdirectory from the subdirectory to the installation path.
Generate the selected file
If you need to specify the startup options when running the server, you can mark them in the command line or set them in a selection file. For the services used each time the server is started, you will find it very convenient to use the selection file to embody your MySQL configuration. Especially in the following cases: when MySQL is started on Windows, it looks for options in two files: my. ini file and C: \ my. cnf file. The typical Windows directory name is C: \ WINDOWS or C: \ WINNT. You can use the following command to determine the value of the WINDIR environment variable: C: \> echo % WINDIR % MySQL first in my. find the options in the ini file, and then in my. cnf file. However, to avoid confusion, it is best to use only one file. If your PC uses the loaded boot device and C: it is not the boot zone, you can only configure it through the my. ini file. No matter which file you select, the file must be in text format. You can also take full advantage of the sample files contained in your MySQL release. Find files such as my-small.cnf, my-medium.cnf, my-large.cnf, and my-huge.cnf in your installation directory that can be renamed and copied to the appropriate location for use as a basic configuration file. A selection file can be generated and modified by any text editor, such as Notepad. For example, if MySQL is installed in the E: \ mysql directory, and the data directory is in the E: \ mydata \ data directory, you can generate a selection file that contains [mysqld] to specify the parameter values of the basic directory and data directory:
[mysqld]
# set basedir to your installation path
basedir=E:/mysql
# set datadir to the location of your data directory
datadir=E:/mydata/data
Note that the Windows path name is embodied in the forward slash used in advance rather than in the backslash selection file. Therefore, when you use a backslash, you must use a double slash.
[mysqld]
# set basedir to your installation path
basedir=E:\\mysql
# set datadir to the location of your data directory
datadir=E:\\mydata\\data
In Windows, the MySQL installer directly installs the data directory in the directory where you install MySQL. If you need to use a data directory in another location, you need to copy the content of the entire data directory to the new location. For example, if MySQL is installed in the C: \ Program Files \ MySQL Server 5.0 directory, the data directory is located in the C: \ Program Files \ MySQL Server 5.0 \ data. If you want to use E: \ mydata as your data directory, you need to do the following two things:
1. Move the entire data directory and all its contents from C: \ Program Files \ MySQL Server 5.0 \ data to E: \ mydata ..
2. Use the -- datadir option to confirm the location of the new data directory each time you start the service.
Select MySQL service type
The following shows the service types provided by MySQL5.0Windows:
mysqld-debug compiles with full debugging and automatic memory allocation checks. The compiled objects also include InnoDB and BDB data tables.
mysqld optimizes binary data supported by InnoDB.
mysqld-nt optimizes binary data supported by named pipes.
mysqld-max optimizes binary data supported by InnoDB and BDB data tables
mysqld-max-nt is the same as mysqld-max, but supports named pipes at compile time 
The above optimization options are for Intel processors, but should be able to work on any Intel i386-class or higher processor. In MySQL 5.0, all Windows servers provide symbolic links to the database directory. MySQL provides support for TCP/IP on Windows. The mysqld-nt and mysql-max-nt servers support named pipelines in Windows NT, 2000, XP, and 2003. However, regardless of the platform, TCP/IP is used by default. (In many Windows configurations, named pipes are slower than TCP/IP Services)
The use of named MPs queues is subject to the following conditions:
The pipeline named pipe is activated only when you select -- enable-named-pipe when you start the service. It is necessary to explicitly use this option because some users have encountered a fault when turning off the MySQL server when the named pipeline is in use. A named pipeline can be used only on the mysqld-nt or mysqld-max-nt Server and only when the server runs on a Windows version that supports named pipelines. In Windows 98 or Me, the services can run only when TCP/IP is installed. The connection to the named MPs queue cannot be used. The above services cannot run in Windows 95. Note: In most examples in the reference manual, mysqld is used as the service name. If you use another server, such as mysqld-nt, you must make a reasonable alternative to the above example.






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.