1 #使用二进制包安装mysql2CP mysql-5.6. in-LINUX-GLIBC2.5-x86_64.tar.gz/data/3tar-xf/data/mysql-5.6. in-LINUX-GLIBC2.5-x86_64.tar.gz-c/data/4mv/data/mysql-5.6. in-LINUX-GLIBC2.5-x86_64/data/MySQL5
6 #创建mysql数据存储目录7mkdir/data/Mysqldata8
9 #添加mysql用户和mysql组TenGroupadd-R MySQL OneUseradd-g Mysql-r-s/sbin/nologin-m-d/data/mysqldata MySQL AChown-r mysql:mysql/data/Mysqldata -
- #初始化数据 theCd/data/mysql &&/scripts/mysql_install_db--datadir=/data/mysqldata--user=MySQL - #创建配置文件, the contents of the configuration file are as follows - #[mysqld] -#basedir =/data/MySQL +#datadir =/data/Mysqldata -#port =3306
+#socket =/tmp/Mysql.sock A#user =MySQL at#innodb_file_per_table = on -#skip_name_resolve = on -#symbolic-links=0
- #[mysqld_safe] -#log-error=/data/mysql/Mysqld.log -#pid-file=/data/mysql/Mysqld.pid in
- #复制启动文件 tocp/data/mysql/support-files/mysql.server/etc/init.d/mysqld +chmod777/etc/init.d/mysqld -
the#修改/etc/init.d/mysqld content, the content is as follows: *#basedir =/data/MySQL $#datadir =/data/MysqldataPanax Notoginseng
- #加入系统库核系统变量 theln-sv/data/mysql/include/usr/include/MySQL +Echo'/data/mysql/lib'>/etc/ld.so.conf.d/mysql.conf A Ldconfig theEcho'export path=/data/mysql/bin/: $PATH'>/etc/profile.d/mysql.sh +source/etc/ Profile -
$ #启动数据库服务 $Service mysqld Start
MySQL binary installation deployment