1、解压mysql安装文件mysql-5.5.47-linux2.6-x86_64.tar.gz;
2、配置mysql环境变量
3、新建mysql用户与mysql组
4、将mysql主目录下所有文件属主改为mysql:mysql;
5、修改$MYSQL_HOME/scripts/mysql_install_db,$MYSQL_HOME/support-files/mysql.server脚本中的basedir,datadir,user配置
6、执行$MYSQL_HOME/scripts/mysql_install_db脚本:
mysql_install_db --user=mysql --basedir=/home/deploy/software/mysql-5.5.47 --datadir=/home/deploy/software/mysql-5.5.47/data
如果报错:error while loading shared libraries: libaio.so.1则:
sudo apt-get install libaio-dev
7、复制配置文件:
cp $MYSQL_HOME/support-files/my-medium.cnf /etc/my.cnf (可覆盖)
8、将mysql服务加入linux系统,将$MYSQL_HOME/support-files/mysql.server复制到 /etc/init.d/mysqld(重命名为mysqld)
cp $MYSQL_HOME/support-files/mysql.server /etc/init.d/mysqld
9、启动mysql服务:
service mysqld start
mysql服务安装成功
10、初始化mysql root密码
mysqladmin -u root password 'new-password'
若无法初始化密码,则到my.cnf中[mysqld]下加入skip-grant-tables,屏蔽密码登录,进入之后再修改root密码
2、配置mysql环境变量
3、新建mysql用户与mysql组
4、将mysql主目录下所有文件属主改为mysql:mysql;
5、修改$MYSQL_HOME/scripts/mysql_install_db,$MYSQL_HOME/support-files/mysql.server脚本中的basedir,datadir,user配置
6、执行$MYSQL_HOME/scripts/mysql_install_db脚本:
mysql_install_db --user=mysql --basedir=/home/deploy/software/mysql-5.5.47 --datadir=/home/deploy/software/mysql-5.5.47/data
如果报错:error while loading shared libraries: libaio.so.1则:
sudo apt-get install libaio-dev
7、复制配置文件:
cp $MYSQL_HOME/support-files/my-medium.cnf /etc/my.cnf (可覆盖)
8、将mysql服务加入linux系统,将$MYSQL_HOME/support-files/mysql.server复制到 /etc/init.d/mysqld(重命名为mysqld)
cp $MYSQL_HOME/support-files/mysql.server /etc/init.d/mysqld
9、启动mysql服务:
service mysqld start
mysql服务安装成功
10、初始化mysql root密码
mysqladmin -u root password 'new-password'
若无法初始化密码,则到my.cnf中[mysqld]下加入skip-grant-tables,屏蔽密码登录,进入之后再修改root密码