Install two mysql database steps in Windows: mysql database

Source: Internet
Author: User

Install two mysql database steps in Windows: mysql database
Because the database versions of the new and old projects are too different, the encoding format is different, and the engine is also different, so we have to install two databases.
Two mysql databases are installed this time, with versions 4.0.18 and 5.5.36 respectively. Are executable files directly installed.
Version 5.5.36 has been installed on the local machine. It is not a problem for a single database. The installation is completed step by step.
For another version, click "Next" to keep installing. Note that you need to find another directory. For example:
5.5.36: d: \ mysql5.5.36 \ 4.0.18: d: \ mysql4.0.18 \
The above experiments have passed in Windows 7 and Windows Server 2008. The configuration for the second database version 4.0.18 is as follows:
1 Configure my. ini
Go to the installation directory, find several my ***. cnf files, and find one as the original configuration. The my-medium.cnf is used here and renamed it my. ini
A total of three changes-1: Find the following configuration section:
[Client]
# Password = my_password
Port = 3306
# Socket = MySQL
Change it:
[Client]
# Password = my_password # version 5.5.36 already occupies the port number 3306, so it is changed to 3307
Port = 3307
# Socket = MySQL # Set the encoding format. Check whether the project uses the default encoding format. If not, add it directly # block it.
Default-character-set = utf8
-2: [mysqld]
Port = 3306
# Socket = MySQL
Change it:
[Mysqld]
Port = 3307
# Socket = MySQL # Similarly, whether the encoding format is changed depends on the project requirements.
# Character-set-server = utf8
-3: key part # Uncomment the following rows if you move the MySQL distribution to another
# Location
# Basedir = d:/mysql/
# Datadir = d:/mysql/data/
Change it:
# Uncomment the following rows if you move the MySQL distribution to another
# Location
Basedir = d:/mysql4.0.18/
Datadir = d:/mysql4.0.18/data/
2. Install the service
-1: Enter the bin directory.
Open cmd and enter the command
D: cd mysql4.0.18 \ bin
-2: The version 5.5.36 installed before the mysql service is installed. The default mysql service name is used: MySQL can open the Task Manager-service to view the service. In version 4.0.18, you must use a new service name named mysql4.0.18.
Enter the bin directory and enter the following code to install the service: mysqld -- install mysql4.0.18 -- defaults-file = 'd: \ mysql4.0.18 \ my. ini'
If the job runs Successfully, the Service Successfully installed is displayed. In this case, open the Task Manager-Service and you can see a mysql4.0.18 Service.
3. Set the password
-1: Keep it in the bin directory at this time. Do not leave. Enter the following code: mysql-u root-P 3307
3307 is the port number. If it is normal, it will connect to the database.
-2: At this time, a mysql symbol is added. Run the following command to set the password:
Mysql> use mysql;
Mysql> update user set password = password ('password you want to set ') where user = 'root ';
Mysql> flush privileges;
Mysql> quit;
Enable and disable the service:
Method 1: You can find the two mysql services in Task Manager-service, right-click the service name, and display start and stop services.
Method 2: Open cmd and enable and disable the service through net start ***/net stop.
Net start mysql // enable the mysql5.36 service. net stop mysql // disable the mysql5.5.36 service.
Net start mysql4.0.18 // enable the mysql4.0.18 service. net stop mysql4.0.18 // disable the mysql4.0.18 service.




How can I install two MYSQL Databases on one machine in windows?

My. the default INI file is in the following path: C: \ Documents ents and Settings \ All Users \ Application Data \ MySQL Server 5.5 \ my. inicopy the INIFILE is stored in E: \ MySQL \ mysql_base. This path can be defined at will and modified as follows: [client] port = 3307 # The default Port of the first database is 3306. here we need to enable another port # The TCP/IP Port the MySQL Server will listen onport = 3307 # Path to installation directory. all paths are usually resolved relative to this. basedir = "E: \ MySQL Server 5.5 \" # the second database basedir # Path to the database root # the second database datadir

How to install MYSQL database in WINDOWS

The preceding operations include "MySQL Server", "Client Programs (mysql Client program)", and "Documentation (document)" to ensure that all files are installed. Click "Change..." to manually specify the installation directory. Enter the installation directory "D:/mysql" and do not place it in the same partition as the operating system. This prevents data from being cleared during system backup and restoration. Press "OK" to continue. Return to the interface and press "Next" to continue. Confirm the previous settings. If there is an error, press "Back" to return the redo. Click "Install" to start installation. Installing. Please wait until the following interface is displayed. Here, you are asked if you want to register a mysql.com account or log on to mysql.com using an existing account. This is generally not required, click "Skip Sign-Up" and click "Next" to Skip this step. Now that the software has been installed, the above interface appears. Here is a good function. mysql Configuration Wizard does not need to be configured manually like before. ini. Check the "Configure the Mysql Server now" and click "Finish" to Finish the software installation and start the mysql Configuration Wizard. Start the mysql Configuration Wizard and press "Next" to continue. Select the Configuration method, "Detailed Configuration (manual precise Configuration)", and "Standard Configuration". Select "Detailed Configuration" to familiarize yourself with the Configuration process. Select the Server type, "Developer Machine (development and testing class, mysql occupies a small amount of resources)", "Server Machine (Server type, mysql occupies a large amount of resources) "," Dedicated MySQL Server Machine (Dedicated database Server, mysql occupies all available resources) ", you choose according to your own type, generally choose" Server Machine ", not too little, it will not be full. Select the general purpose of the mysql Database, "Multifunctional Database (Universal multi-function type, good)", "Transactional Database Only (server type, dedicated to transaction processing, General) "," Non-Transactional Database Only (non-transaction processing type, relatively simple, mainly used for monitoring and recording, the support for MyISAM data types is limited to Non-transactional ), I chose it with my own purpose. Here I select "Transactional Database Only" and press "Next" to continue. Configure InnoDB Tablespace to select a bucket for the InnoDB database file. If you modify the bucket, remember the location and select the same place for the reinstallation. Otherwise, the database may be damaged, of course, it is okay to back up the database. We will not detail it here. I didn't modify it here. I used the default location to directly press "Next" to continue to select the General mysql access volume for your website, and the number of connections at the same time, "demo-support (DSS) /OLAP (about 20) "," Online Transaction Processing (OLTP) (about 500) "," Manual Setting (manually set, input a number by yourself )", here I select "Online Transaction Processing (OLTP)" And my server should be enough. Press "Next" to enable TCP/IP connection and set the port. If not, you can only access the mysql database on your own machine. I enable it here and tick the previous one, Port Number: 3306, it is important to press "Next" to continue this operation ...... remaining full text>

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.