MySQL Source compilation installation

Source: Internet
Author: User


1, installation cmake-2.8.10.2.tar.gz

Enter the shell with the root user

#tar-ZXVF cmake-2.8.10.2.tar.gz

#cd cmake-2.8.10.2

#./configure

#make (Cannot make, detects GCC compilation environment)

#make Install

---------------------------------

2, Installation ncurses-5.9.tar.gz

#tar-ZXVF ncurses-5.9.tar.gz

#cd ncurses-5.9

#mkdir/usr/local/ncurses-5.9/

#./configure--prefix=/usr/local/ncurses-5.9/

#make

#make Install

--------------------

3, Installation mysql-5.5.28.tar.gz

#tar-ZXVF mysql-5.5.28.tar.gz

#cd mysql-5.5.28

#mkdir-P/usr/local/mysql (CREATE database installation directory)

#mkdir-P/usr/local/mysql/data (storage database)

#groupadd MySQL

#useradd-R-G MySQL MySQL

Start compiling MySQL source code

#cmake. -dcmake_install_prefix=/usr/local/mysql/-dmysql_datadir=/usr/local/mysql/data-dcurses_include_path=/usr/local/ ncurses-5.9/include/-DCURSES_LIBRARY=/USR/LOCAL/NCURSES-5.9/LIB/LIBNCURSES.A

#make

#make install (this is done with MySQL)

-----------------------

4. Configure MySQL

Set directory Permissions

#cd/usr/local/mysql

#chown-R root:mysql. (The owner owner of all files in the current directory is set to root, and the group is MySQL)

#chown-R mysql:mysql Data

#cp support-files/my-medium.cnf/etc/my.cnf (add MySQL startup service to system service)

Create a table for the system database

#cd/usr/local/mysql

#scripts/mysql_install_db--user=mysql

Manually start MySQL

#cd/usr/local/mysql

#./bin/mysqld_safe--user=mysql &

# mysqladmin-u root-p shutdown (stop MySQL service, here MySQL root user has not configured password, so is null value.) If you need to enter a password, just click Enter. )

Another simple way to start MySQL (MySQL has been added to the system service)

#cp support-files/mysql.server/etc/init.d/mysql (add MySQL startup service to system service)

# service mysql.server start MySQL service

# service Mysql.server stop shutdown MySQL Service

# service Mysql.server Restart restart MySQL Services

Add MySQL to the environment variable to enter MySQL in the shell environment MySQL

#vi/etc/profile

At the end of the join

Export Mysql_home=/usr/local/mysql

Export path= $MYSQL _home/bin: $PATH

#wq Save

#source/etc/profile Refresh the configuration file

After you've typed MySQL, you can see the MySQL console operator interface.

Modify the password of the root user of MySQL and open the remote connection

# mysql-u Root MySQL

Mysql>use MySQL;

Mysql>desc user;

Mysql> GRANT All privileges on * * to [email protected] '% ' identified by ' root '; (The ability to add remote connections for root.) )

Mysql>update user Set Password = Password (' root ') where user= ' root '; (Set root user password as root, customizable)

Mysql>select Host,user,password from User where user= ' root ';

Mysql>flush privileges;

Mysql>exit

Re-login: Mysql-u root-proot

If remote connections are not yet in progress, turn off the firewall

#/etc/rc.d/init.d/iptables Stop


This article is from the "8159085" blog, please be sure to keep this source http://8169085.blog.51cto.com/8159085/1842959

MySQL Source compilation installation

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.