5.5.XX MySQL Compilation Installation

Source: Internet
Author: User
Tags chmod


CMake installing MySQL 5.5

##############

1, first install cmake software

cd/home/lvnian/tools/

Tar XF cmake-2.8.8.tar.gz

CD cmake-2.8.8

./configure

#CMake has bootstrapped. Now run Gmake.

Gmake

Gmake Install

Cd.. /



########################

2. Install dependent packages

Yum Install Ncurses-devel-y


########################

3. Create users and Groups

Groupadd MySQL

Useradd mysql-s/sbin/nologin-m-G MySQL


########################

4, cmake install MySQL

cd/home/lvnian/tools/

Tar zxf mysql-5.5.32.tar.gz

CD mysql-5.5.32

CMake. -dcmake_install_prefix=/application/mysql-5.5.32 \

-dmysql_datadir=/application/mysql-5.5.32/data \

-dmysql_unix_addr=/application/mysql-5.5.32/tmp/mysql.sock \

-ddefault_charset=utf8 \

-DDEFAULT_COLLATION=UTF8_GENERAL_CI \

-DEXTRA_CHARSETS=GBK,GB2312,UTF8,ASCII \

-denabled_local_infile=on \

-dwith_innobase_storage_engine=1 \

-dwith_federated_storage_engine=1 \

-dwith_blackhole_storage_engine=1 \

-dwithout_example_storage_engine=1 \

-dwithout_partition_storage_engine=1 \

-dwith_fast_mutexes=1 \

-dwith_zlib=bundled \

-denabled_local_infile=1 \

-dwith_readline=1 \

-dwith_embedded_server=1 \

-dwith_debug=0

Make && make install


#--Build files has been written to:/home/oldboy/tools/mysql-5.5.32

Tip, there are many options to configure at compile time, refer to the end of the appendix or official documentation:

Make

#[100%] Built Target my_safe_process

Make install

Ln-s/application/mysql-5.5.32//application/mysql

If there is no error in the above operation, the installation of the MYSQL5.5.32 software CMake mode is successful.

########################

Configuring the MySQL configuration file

cd/home/lvnian/tools/mysql-5.5.32

CP SUPPORT-FILES/MY-SMALL.CNF/ETC/MY.CNF


########################

Initializing the database

Chown-r Mysql.mysql/application/mysql/data

Chmod-r 1777/tmp/

cd/application/mysql/scripts/

./mysql_install_db--basedir=/application/mysql--datadir=/application/mysql/data--user=mysql

##############

If the following two OK appears, the initialization is successful.

Installing MySQL system tables ...

Ok

Filling Help Tables ...

Ok


The following warning is also normal

Warning:the host ' MySQL ' could not being looked up with RESOLVEIP.

If you want the warning to not appear:

Then add the hostname displayed in the hostname in the/etc/hosts


########################

Start MySQL

Netstat-lnt

/application/mysql/bin/mysqld_safe &

Netstat-lnt

NETSTAT-LNT |grep 3306

########################

To set the traditional boot method:

/bin/cp/home/lvnian/tools/mysql-5.5.32/support-files/mysql.server/etc/init.d/mysqld

chmod +x/etc/init.d/mysqld

/etc/init.d/mysqld stop

Netstat-lnt

/etc/init.d/mysqld start

Netstat-lnt


########################

Setting the MySQL environment variable

echo "path= $PATH:/application/mysql/bin/" >>/etc/profile

Source/etc/profile

which MySQL

########################

Go to MySQL

Mysql


MySQL Simple optimization

Delete from Mysql.user where host= ':: 1 ';

Delete from mysql.user where host= ' MySQL '; # #这个mysql是主机名

Delete from mysql.user where host= ' localhost ' and user= ';

can also be deleted with drop

show databases;

drop database test;

show databases;

################################


Add an additional administrator

Delete from Mysql.user;

Grant all privileges on * * to [email protected] ' localhost ' identified by ' lvnian2009 ' with GRANT option;


Flush privileges;


###### #给mysql添加密码:

Add a user password under the Linux command line

/application/mysql/bin/mysqladmin-uroot Password Lvnian

Modify the user password under the Linux command line

Mysqladmin-uroot-p ' Lvnian ' password ' lvnian2009 '

############# #设置mysql开机自启动

Chkconfig--add mysqld

Chkconfig mysqld--list

Chkconfig mysqld on

Chkconfig mysqld--list


This article is from the "Struggle Bar" blog, please be sure to keep this source http://lvnian.blog.51cto.com/7155281/1698823

5.5.xx MySQL Compilation 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.