安装二进制mysql_mysql 的安装(二进制安装)

1、常见软件的安装方式及优缺点:

yum安装

yum -y install 软件名

优点:简单,高效,自动解决安装包之间的依赖问题

缺点:无法定制

rpm安装

rpm -ivh 包名.rpm

优点:可以定制

缺点:主要是各个包之间的依赖关系

编译安装

configure (配置) make(编译) make install(安装)

优点:可以定制

缺点:复杂,低效

2、mysql的安装过程(源码安装:https://blog.51cto.com/13754781/2300378)

useradd mysql -s /sbin/nologin -M

cd /home/tools #存放mysql-5.5.49-linux2.6-x86_64.tar.gz

tar xf mysql-5.5.49-linux2.6-x86_64.tar.gz

mv mysql-5.5.49-linux2.6-x86_64 /application/mysql-5.5.49

ln -s /application/mysql-5.5.49/ /application/mysql

cd /application/mysql

chown -R mysql.mysql /application/mysql/

./scripts/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql

/bin/cp support-files/my-small.cnf /etc/my.cnf(忽略提示)

cp support-files/mysql.server /etc/init.d/mysqld

sed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe /etc/init.d/mysqld

/etc/init.d/mysqld start

echo 'export PATH=/application/mysql/bin:$PATH'>>/etc/profile

source /etc/profile

systemctl enable mysqld

mysqladmin -u root password 'workjob' #更改mysql的登录密码,默认无登录密码

mysql -u root -p

你可能感兴趣的:(安装二进制mysql)