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!