MySQL Environment setup

Source: Internet
Author: User
Tags gz file

The next command on the CentOS can install MySQL, but after the installation, feel very dazed, so I try to start with the compression package, green installation, so you can have more knowledge of MySQL.

Description

The next command on the CentOS can install MySQL, but after the installation, feel very dazed, so I try to start with the compression package, green installation, so you can have more knowledge of MySQL.
Start below!

No. 0 Step: Prepare

Operating system: CentOS6.3 64-bit

1th Step: Download the installation package

The address of the MySQL official website is: http://dev.mysql.com/downloads/mysql/Of course you may also download the not smooth, because I have met said dead also cannot download non-Windows version of the situation.

Platform Select Linux-generic and select the bottom tar.gz file to download.
Below the Linux command line, you can use the following command to download:
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz
We downloaded the file under the/data/download directory.

2nd step: Install MySQL

Unzip the mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz:

[Email protected] download]$ TAR-ZXF mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz

After extracting, we move the extracted directory to the unified installation directory:

[Email protected] download]$ MV Mysql-5.6.14-linux-glibc2.5-x86_64/data/server

If you do not want to move, you can build a symbolic link in the/data/server directory, referring to the extracted directory can be

[[email protected] server]$ ln-s/data/download/mysql-5.6.14-linux-glibc2.5-x86_64 MySQL

3rd Step: Configure MySQL

Build MySQL User

Create a new MySQL account in the operating system and change the password, our MySQL server will use this account to launch.

[[email protected] server]$ useradd MySQL

[[email protected] server]$ passwd MySQL

Modify the MySQL installation directory owner for the MySQL account:

[[email protected] server]$ chown-r MySQL MySQL

Generate MySQL Authorization form

A lot of MySQL does not start up, reported less what the table, can be executed by the script to solve the problem:

[Email protected] mysql]$ CD scripts/

[[email protected] scripts]$ ls

mysql_install_db

[Email protected] scripts]$/mysql_install_db--user=mysql--basedir=/data/server/mysql--datadir=/data/server/ Mysql/data

Modify the MySQL my.cnf configuration file

This configuration file is available under the Support-files directory and can be modified by selecting the appropriate configuration file as needed.
There are several places that need to be modified:
Under the [Mysqld] section, add the following:

Basedir =/data/server/mysql

DataDir =/data/server/mysql/data

Innodb_data_home_dir =/data/server/mysql/data

Innodb_log_group_home_dir =/data/server/mysql/data

Modify the memory size of the cache, because the server only 8G of memory, but also to run Hadoop Datanode, so set to 512M:

Key_buffer_size = 512M

Innodb_buffer_pool_size = 512M

Set Database memory

Key_buffer_size = 512M

Innodb_buffer_pool_size = 512M

Setting case insensitivity

Lower_case_table_names = 0

Set encoding

Character_set_server=utf8

Copy the configuration file to the/etc directory

$ CP my.cnf/etc/

Start the MySQL server

Copy the MySQL service to the startup directory, and if you don't want to call the MySQL service name Mysql.server, you can also name it when you copy it, such as MySQL.

$ cp/data/server/mysql/support-files/mysql.server/etc/init.d/

Start MySQL

$ Service Mysql.server Start | Stop | Restart | Status

4th step: Set Boot start

$ chkconfig--level 235 Mysql.server on

5th step: Start using

MySQL Environment setup

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.