Binary installation:[[email protected] ~]# mkdir /home/lufeng/tools -p[[email protected] ~]# cd /home/lufeng/tools [[email protected] tools]# rz[[email protected] tools]# tar xf mysql-5.5.49-linux2.6-x86_64.tar.gz[[email protected] tools]# mkdir -p /application/mysql-5.5.49[[email protected] tools]# mv mysql-5.5.49-linux2.6-x86_64 /application/mysql-5.5.49 create a MySQL user | group [[email protected] tools]# groupadd mysql[[email protected] tools]# useradd mysql -g mysql -s /sbin/nologin -m initialization configuration file [[email protected] tools]# ln -s /application/ mysql-5.5.49/ /application/mysql[[email protected] tools]# cd /application/mysql[[ EMAIL PROTECTED] MYSQL]# CP SUPPORT-FILES/MY-SMALL.CNF /ETC/MY.CNF initializing the database file [[email protected] mysql]# mkdir -p /application/mysql/data[[email protected] mysql]# chown -r mysql.mysql /application/mysql/[[email protected] mysql]# /application/mysql/scripts /mysql_install_db --basedir=/application//mysql --datadir=/application/mysql/data --user= MySQL Configuration and start mysql[[email protected] mysql]# cp support-files/mysql.server /etc/init.d/ Mysqld[[email protected] mysql]# chmod +x /etc/init.d/mysqld[email protected] mysql]# sed -i ' S#/usr/local/mysql#/application/mysql#g ' /application/mysql/bin/ mysqld_safe /etc/init.d/mysqld[[email protected] mysql]# /etc/init.d/mysqld startstarting mysql... success! [[email protected] mysql]# netstat -lntup| grep mysqltcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2951/mysqld Configuring global Use Path [[email protected] ~]# echo ' Export path=/application/mysql/bin: $PATH ' >>/etc/profile[[ email protected] ~]# tail -1 /etc/profileexport path=/application/mysql/bin:$ path[[email protected] ~]# echo $PATH/application/mysql/bin:/applicaion/mysql/bin:/ Applicaion/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin Security Configuration:[[email protected] ~]# mysqladmin -u root password ' 199429 ' [[email protected] ~]# mysqlerror 1045 (28000): access denied for user ' root ' @ ' localhost ' (Using password:&nbsP;no) [[Email protected] ~]# mysql -uroot -p Delete Redundant users: +------+-----------+| user | host |+------+-----------+| root | 127.0.0.1 | | root | localhost |+------+-----------+
This article is from the "Trance" blog, make sure to keep this source http://bestlufeng.blog.51cto.com/11790256/1912674
MySQL database simple installation (binary)