Source code compilation Install MySQL

Source: Internet
Author: User
Tags administrator password

Try out the source code to install MySQL today.

This time we will use the CMake tool to install the CMake.

# yum Install CMake

# TAR-XF Mysql-5.5.37.tar.gz

# CD mysql-5.5.37

# groupadd-r MySQL

# useradd-g Mysql-r-d/mydata/data/mysql

# CMake. -dcmake_install_prefix=/usr/local/mysql \ Specify the installation path

-dmysql_datadir=/mydata/data \ Specify the data file path

-DSYSCONFDIR=/ETC \ Specify the profile path

-dwith_innobase_storage_engine=1 \ Specifies that the Innobase storage engine is compiled

-dwith_archive_storage_engine=1 \

-dwith_blackhole_storage_engine=1 \

-dwith_readline=1 \ Support data import and export function

-dwith_ssl=system \ Support SSL

-dwith_zlib=system \ Support ZLIB Library

-dwith_libwrap=0 \

-dmysql_unix_addr=/tmp/mysql.sock \ Specify a socket file to communicate with the native

-DDEFAULT_CHARSET=UTF8 \ Supported character sets

-ddefault_collation=utf8_general_ci Default Sorting rules

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/30/EA/wKioL1Opj23CCSMnAAJ9MvvnOMY802.jpg "title=" L6jvijlqy7]df{6o{x15eo3.jpg "alt=" wkiol1opj23ccsmnaaj9mvvnomy802.jpg "/># make && make install

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/30/EA/wKioL1Opj47SQMxXAAJcAGhvHYk971.jpg "title=" 6v0g] a97t%h175 (o]t ' xfd0.jpg "alt=" Wkiol1opj47sqmxxaajcaghvhyk971.jpg "/>

# Cd/usr/local/mysql

# ln-sv/usr/local/mysql/include//usr/include/mysql

# vim/etc/ld.so.conf.d/mysql.conf

/usr/local/mysql/lib

# Ldconfig

# vim/etc/profile.d/mysql.sh

Export Path=/usr/local/mysql/bin: $PATH

# . /etc/profile.d/mysql.sh

# CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF

# CP Support-files/mysql.server/etc/init.d/mysqld

#./scripts/mysql_install_db--user=mysql--datadir=/mydata/data/

# chkconfig--add mysqld

# service Mysqld Start

This completes the installation and starts up successfully.

> Show processlist; Displays the current list of MySQL server threads

Modify User Password

> Update user Set Password=password (' Redhat ') where user= ' root ';

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/30/EC/wKioL1OpljaRrcjJAAFkdH9wXb4123.jpg "title=" UDPLFN $IU ~byl_y] ' tkmey4.jpg "alt=" Wkiol1opljarrcjjaafkdh9wxb4123.jpg "/>

> Flush Privileges;

What if I forget my MySQL administrator password?

# Vim/etc/init.d/mysqld

Find Start

Add two parameters to the start of the service,--skip-grant--skip-networking. Then restart the service to skip the password.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/30/ED/wKioL1OpmJ3DJhrpAAHYdvkBkoo226.jpg "title=" 7v_~ TLLV] @NNBX%{cg5jfik.jpg "alt=" Wkiol1opmj3djhrpaahydvkbkoo226.jpg "/>



This article from the "Bad Guys Blog" blog, reproduced please contact the author!

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.