PostgreSQL and MySQL Database installation

Source: Internet
Author: User
Tags locale postgresql

1. Environment preparation

1.1 Win7 x64 system

1.2 Postgresql-9.1.13-windows-binaries.zip and Mysql-5.5.46-win32.zip

2. Installation process

2.1 Postgresql-9.1.13 installation process

① extract the Zip-format installation package to a folder, such as D:\pgsql.

② creates a new data folder under the D:\postgresql folder, which is used primarily to store the database.

③ Set Environment variables (computer properties advanced settings), here mainly set the system environment variables, respectively, the following several: Pghome,pghost,pglib,pgdata, and finally add PostgreSQL bin path in the PATH environment variable.

Pghome= "D:\pgsql"----is the installation path of PostgreSQL

pghost= "localhost"

pglib=%pghome%+ "\lib"

pgdata=%pghome%+ "\data"

path=;+ "Pghome" +\bin

④ initializing and creating the database

Open the CMD command-line window, hold down the SHIFT key under the D:\pgsql\bin folder, right-click to open a command-line window, and run the following code:

initdb.exe-d D:\pgsql\data-E utf-8 --locale=chs-u postgres-w

-D: (directory) specifies the default storage directory for the database

-e: (Encoding) specifies the default encoding for the database

--locale: About Regional Settings

-U: (user) Specifies the super user name of the database Postgres

-W: Specify password hint for super user

⑤ starting the database

If you do not register as a system service, you need to start each time manually, and the Pgadmin3 connection database fails, and in the Just Bin directory cmd window, enter:

Pg_ctl start

Register as a system service:

Pg_ctl register-n postgresql-d D:\pgsql\data

Start the appropriate system service:

net start PostgreSQL

⑥ Configuring the PgAdmin3 Client connection database, testing the database connection

First, you need to add a new database connection, the name of the connection can pick up, the host can use localhost, the port number is not changed, the database can be filled postgres, the user name is just registered in the command line Postgres, password is also used just registered.

The 6 steps above will complete the PostgreSQL database installation.

2.2 mysql-5.5.46 installation process

① Unzip the ZIP installation package into the C:\mysql

② register System variables, respectively mysql_home and add paths in path

Mysql_home=c:\mysql

Path=;%mysql_home%\bin

③ Modifying a configuration file

Open the My-small.ini under the MySQL folder with Notepad

First, add Default-character-set=utf8 under [client]

Next, add the following under [Mysqld]:

Basedir= "C:/mysql"

Datadir= "C:/mysql/data"

Character-set-server=utf8

Save the modified file as My.ini and save it under the current path

④ Start Service

Open the CMD Command Line window and enter the command:

MySQL--console

The following interface appears indicating that the MySQL service is started

⑤ login and set the root account password

Open a new CMD command line window and enter the command:

Mysql-uroot     

An interface appears indicating that the login was successful.

Execute the Change Password command:

Use mysql;update user set password=password ("your password") where user='  root'

Finally, log in to MySQL using the new password in the new CMD command Line window

Mysql-u root-p

Next you can register the MySQL service as a system service and enter the command in CMD:

Mysqld.exe--install MySQL5. 5 --defaults-file="c:/mysql/my.ini"net start MySQL5. 5

The MySQL service is started.

This is the installation steps of MySQL, you can also use the graphical interface client to manage MySQL, such as navicat,phpadmin, etc.

Above software: Http://yunpan.cn/cFddFhkDGMLIV

Extract code: eb6f

PostgreSQL and MySQL Database installation

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.