Create MySQL for PHP applications

Source: Internet
Author: User
Tags configuration settings mysql command line

Overview

This article provides a basic tutorial on how to install and configure MySQL in a Windows operating system. For more information about installing and configuring MySQL on Windows, see the MySQL official documentation.


Download and install MySQL

The MySQL installation package can be downloaded from the official MySQL website. This document describes how to install Windows MSI Installer in MySQL 5.1 Community Edition.
Run the installation package and select the installation option. In most cases, the typical installation is sufficient:

If you want to control which components need to be installed, or you want to use a non-default installation path, select the "Custom" option.
After the installation is complete, confirm that the "Configure the MySQL Server now" option is selected. This operation will enable the "MySQL Server Instance Configuration Wizard", and this Wizard will guide you to configure the MySQL Instance.

Configure a MySQL instance

Follow the steps below in "MySQL Server Instance Configuration Wizard" to customize and complete the configurations for the tasks you expect MySQL to complete.
On the first page of the wizard, select "Detailed Configuration"

On the next page, select the server type option:

Select "Database Usage"

Database usage options are used to control which database storage engine is used on the server:

  • MyISAM-complete and efficient SELECT operations. It costs less in terms of memory storage and disk usage, but at the cost of not supporting transactions.
  • InnoDB-provides all ACID transaction mechanisms, but at the cost of more complex disk space and memory storage.

For more information about these database engines, see MySQL storage engine architecture. As a general suggestion-if Web applications on your server require multi-state transactions, advanced isolation level and row-level locking, foreign key constraints, or other ACID functional requirements-use InnoDB; otherwise, use MyISAM.
Then select the number of concurrent connections executed on the server:

Select a network on the next page:

If you have MySQL and Web Server on the same computer, you can use the name pipe instead of activating the TCP/IP network. Note that some PHP applications may need to use TCP to connect to MySQL. See the application documentation to determine whether the application supports connection to MySQL through the name pipeline.
Select the default character set when creating a new database:

Then confirm that MySQL will be configured like Windows Service:

You can add the MySQL Bin library to the Windows Path environment variable. This operation makes it easier to use MySQL from the command line.
Finally, set a password for the database administrator account named "root" in MySQL. Confirm that the "Create an Anonymous Account" option is not selected:

On the write page, click "Execute" to agree to all configuration settings and start a MySQL service:

Now you can enter the following command in the command line window to log on to MySQL:

mysql -u root -pEnter password: ******

If the MySQL configuration is successful, it will be displayed in the MySQL command line window:

Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 3Server Version 5.1.32-community MySQL Community Server (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>

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.