Install centos6.3 + mysql-5.5.28 data on vmware9.0 (Reprinted from Guofeng Changchun)

Source: Internet
Author: User
Tags windows visual automake

Reprinted from cnblogs Changchun Zhou Feng http://www.cnblogs.com/cczhoufeng/archive/2012/12/13/2807648.html
Install centos6.3 + mysql-5.5.28 database on vmware9.0 (currently MySQL stable version is 5.2.29)

OriginalArticle, Please respect the author's hard work.

1. Install centos6.3 on a VM

Ii. Install MySql in centos

Software Version:

    • CentOS-6.3-x86_64
    • Mysql-5.5.28
    • Gcc4.1.3
    • Cmake-2.8.4

1.1.1 create a new virtual machine and select the custom mode (custom)

1.1.2 select system later

1.1.3 select Linux OS, centos 64-bit version (because I use CentOS-6.3-x86_64)

1.1.4 set the Virtual Machine name and storage location (select a large disk space)

1.1.5 set the number of processors

1.1.6 set the memory size

 

1.1.7 select the network connection mode. Here, select the NAT mode.

Note:

L bridged: bridge connection. You must configure an IP address to connect to the Internet.

L NAT: the host machine is used as the proxy to connect to the Internet. No IP address is required.

L host-only: the virtual machine is only connected to the host machine

Select the next default configuration after 1.1.8. When you view the custom configuration, select the custom configuration.

1.1.9 select the optical drive and load the centos ISO Installation File

1.1.10 configure Virtual Machine Nat Internet access settings, select the "edit" tab, and select "Virtual Network Editor"

Note: 192.168.88.9 is the IP address of the local area network of the host machine. In order to set an IP address for the Virtual Machine to facilitate connection.

 

1.1.11 start creating a VM

1.1.12 skip the check

1.1.13 select English as the operating language)

1.1.14 keyboard Selection

1.1.15 select to install and use the device

1.1.16 set the Host Name and network of the computer

Note:

L remember to select connect automatically (automatic link ).

L gateway configures IP addresses for the Virtual Machine Nic

 

1.1.17 set the server time.

1.1.18 set the server password

1.1.19 select the installation type. All spaces are used here.

1.1.20 select additional software installation

1.1.21 restart the server after the installation is complete

2.0InstallCmake

 

Note: cmake is a cross-platform installation (Compilation) tool. You can use simple statements to describe the installation (compilation process) of all platforms ). He can output a variety of makefiles or project files and TestCompilerThe supported C ++ features are similar to automake in UNIX. Just
CmakeConfiguration FileName cmakelists.txt. Cmake does not directly construct the final software, but generates standard construction files (such as UNIX makefile or Windows visual
C ++ projects/workspaces), and then use it in the general construction mode. This makes you familiar withIntegrated Development Environment(IDE) developers can build their software in a standard way, which can use the native construction capability of various platforms to build the system is
Differences between cmake and scons and other similar systems.

Cmake can be compiledSource code, ProductionLibrary, Generate an adapter (wrapper), and construct it in any order.Execution File. Cmake
Support in-place ConstructionSourceCodeIn the same directory tree) and out-of-place Construction (binary files in other directories ), therefore, it is easy to construct multiple binary files from the same source code directory tree. Cmake
Also supports static and dynamicLibrary.

"Cmake" is short for "cross platform make. Although the name contains "make", the common "make" systems on cmake and Unix are separated and higher.

My MySQL directory configuration is as follows:

Installation path:/usr/local/MySQL

Database path:/data/MySQL

Source code package storage location:/usr/software

First, I created the directory where the source code package is stored:

Mkdir/usr/software

CD/usr/software/

WgetHttp://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.28.tar.gz

Preparation: Install the basic dependency package. First install cmake, automake, and Autoconf with Yum. Also, the minimum packages required for MySQL 5.5.x include bison, GCC, GCC-C ++, and ncurses-devel.

[Root @ mysql-master1 software] #CD

[Root @ mysql-master1 ~] #Yum install cmake make-y

[Root @ mysql-master1 ~] #

Yum install GCC gcc-C ++ Autoconf bison automake zlib * fiex * libxml * ncurses-devel libmcrypt * libtool-ltdl-devel *-y

[Root @ mysql-master1 ~] #CD/usr/software

Start compilation and Installation

[Root @ mysql-master1 software] #Tar-zxvf mysql-5.5.28.tar.gz

[Root @ mysql-master1 software] #CD mysql-5.5.28

[Root @ mysql-master1 mysql-5.5.28] #

Cmake-dcmake_install_prefix =/usr/local/MySQL-dmysql_unix_addr =/data/MySQL. Sock-ddefault_charset = utf8-ddefault_collation = utf8_general_ci
-Dwith_extra_charsets: String = utf8, GBK-encoding = 1-dwith_readline = 1-denabled_local_infile = 1-dmysql_datadir =/data/MySQL/-dmysql_tcp_port = 3306

[Root @ mysql-master1 mysql-5.5.28] #Make & make install

[Root @ mysql-master1 mysql-5.5.28] #CD

[Root @ mysql-master1 ~] #Groupadd MySQL

Add a MySQL user group

[Root @ mysql-master1 ~] # Useradd mysql-G mysql-S/sbin/nologin

Add a MySQL user

[Root @ mysql-master1 ~] #CD/usr/local/MySQL
[Root @ mysql-master1 MySQL] #Chown mysql. mysql-R.

# Grant the MySQL directory execution permissions to mysql users

[Root @ mysql-master1 MySQL] #Mkdir/data/MySQL-P

[Root @ mysql-master1 MySQL] #Chown mysql. mysql-r/data/MySQL

[Root @ mysql-master1 MySQL] #CP support-files/my-medium.cnf/etc/My. CNF

Y press ENTER

# MySQL configuration file

[Root @ mysql-master1 MySQL] #Chmod 755 scripts/mysql_install_db

# Grant the execution permission of mysql_install_db

Run the following command to configure MySQL startup and Automatic startup:

[Root @ mysql-master1 MySQL] #Scripts/mysql_install_db -- user = MySQL -- basedir =/usr/local/MySQL -- datadir =/data/MySQL/

 

Add Virtual Machine IP address and Host Name

[Root @ mysql-master1 MySQL] #VI/etc/hosts

Note: because the author has modified it later, we should add 192.168.88.10 mysql1 as per this article.

Re-Execute

[Root @ mysql-master1 MySQL] #Scripts/mysql_install_db -- user = MySQL -- basedir =/usr/local/MySQL -- datadir =/data/MySQL/

 

 

[Root @ mysql-master1 MySQL] #CP support-files/MySQL. Server/etc/init. d/mysqld

[Root @ mysql-master1 MySQL] #Chmod 755/etc/init. d/mysqld

Check whether the mysqld service is set to start upon startup

[Root @ mysql-master1 MySQL] #Chkconfig -- list | grep mysqld

Set to boot

[Root @ mysql-master1 MySQL] # Chkconfig mysqld on

Starting the MySQL database will output a series of useful information, telling you how to initialize MySQL

[Root @ mysql-master1 MySQL] #Service mysqld start

Let's initialize the administrator root password.

[Root @ mysql-master1 MySQL] #/Usr/local/MySQL/bin/mysqladmin-u Root Password '000000'

As we all know, MySQL has two account types: localhost and %. The former only allows the local machine to connect to MySQL, and the latter can be used for other machines to remotely connect to MySQL.

Finally, handle account logon issues so that the root account password can be used locally and remotely.

[Root @ mysql-master1 MySQL] #/Usr/local/MySQL/bin/MySQL-u root-p123456

# After you press this command, the screen will prompt you to enter the password and enter yourpassword set in the previous step.
Delete records with empty root passwords
Mysql>Use MySQL;
Mysql>Delete from user where Password = '';
Mysql>Flush privileges;

Configure MySQL to allow remote root login

# Logon

Mysql>Grant all privileges on *. * to root @ '%' identified by "root ";

Mysql>Update user SET Password = PASSWORD ('000000') where user = 'root ';
Mysql>Flush privileges;

Mysql>Select User, password, host from user;

If the preceding command is successfully executed, the result should be as follows:

Mysql>Quit

Configure iptables and enable port 3306. The configuration is as follows:

 [Root @ mysql-master1 MySQL] #VI/etc/sysconfig/iptables

-A input-p tcp-M state -- state new-m tcp -- dport 3306-J accept

Restart iptables to apply the configuration.

The [root @ MySQL mysql-5.5.28] # service iptables restart

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.