rpm Package Install MySQL
There are many ways to install MySQL, and now we are mainly talking about binary installation MySQL database.
Useradd mysql-s/sbin/nologin–m #创建用户tar XF mysql-5.5.32-linux2.6-x86_64.tar.gzmv mysql-5.5.32-linux2.6-x86_64/ Application/mysql-5.5.32ln-s/application/mysql-5.5.32//application/mysql/application/mysql/scripts/mysql_ install_db--basedir=/application/mysql/--datadir=/application/mysql/data/--user=mysql
See the following message stating the success of MySQL initialization:
Installingmysql system tables ... Okfillinghelp tables ... Ok
Chown-r Mysql.mysql/application/mysql #授权
Generate MySQL configuration file
Cp/application/mysql/support-files/my-small.cnf/etc/my.cnfcp:overwrite '/etc/my.cnf '? Y
Configure start MySQL, modify MySQL path, and start MySQL
Sed-i ' S#/usr/local/mysql#/application/mysql#g '/application/mysql/bin/mysqld_safe
Running in the background
/application/mysql/bin/mysqld_safe &
Configuring Environment variables
Vim/etc/profile path= "/application/mysql/bin: $PATH" Source/etc/profile #使变量生效
Configured as a traditional service startup mode
Cp/application/mysql/support-files/mysql.server/etc/init.d/mysqld
Replace path
Sed-i ' S#/usr/local/mysql#/application/mysql#g '/etc/init.d/mysqld
Start the service
/etc/init.d/mysqld Startshuttingdown mysql.broadcastmessage from [e-mail protected] (/dev/pts/0) at 21:53 ... Thesystem is going down for reboot now! success! Startingmysql.
To view ports:
Netstat-lntup |grep 3306
Change Password
Mysqladmin-uroot password ' 123 '
Log in to Database
Mysql-uroot-p ' 123 '
The database installation is complete.
This article is from the "Lanzhi" blog, make sure to keep this source http://7826443.blog.51cto.com/7816443/1706133
MySQL Database < four >