Groupadd MySQL Add user group
Useradd mysql-s/sbin/nologin-g mysql-m Add Users
MV mysql-5.5.54-linux2.6-x86_64.tar.gz/home/ye/software/download software to package
Cd/home/ye/software/
TAR-XF mysql-5.5.54-linux2.6-x86_64.tar.gz #解压mysql软件
CD mysql-5.5.54-linux2.6-x86_64
mv/home/ye/software/mysql-5.5.54-linux2.6-x86_64//application/mysql-5.5.54/Mobile Package to the installation path
cd/application/mysql-5.5.54/
Ln-s/application/mysql-5.5.54//application/mysql #创建软连接
Ls-l/application/mysql/support-files/*.cnf
CP/APPLICATION/MYSQL/SUPPORT-FILES/MY-SMALL.CNF/ETC/MY.CNF Configuration Profile
Mkdir-p/application/mysql/data Create data Directory
Chown-r mysql.mysql/application/mysql/#修改目录权限
/application/mysql/scripts/mysql_install_db--basedir=/application/mysql--Datadir=/application/mysql/data--user =mysql #初始化mysql
tree/application/mysql/data/#查看
CP Support-files/mysql.server/etc/init.d/mysqld
chmod +x/etc/init.d/mysqld Add Permissions
Ll/etc/init.d/mysqld
Sed-i ' S#/usr/local/mysql#/application/mysql#g '/application/mysql/bin/mysqld_safe/etc/init.d/mysqld # To modify the default program execution path within a configuration file
/etc/init.d/mysqld start MySQL
/application/mysql/bin/mysqld_safe--user=mysql& #另一种方式启动MYSQL
Netstat-lntup to see if Port 3306 is started
Chkconfig--add mysqld Add service
Chkconfig mysqld on set MySQL service on default boot
Chkconfig--list mysqld View service status
Echo ' Export path=/application/mysql/bin: $PATH ' >>/etc/profile #更改mysql命令的全局环境变量; another way to put/application/mysql/ bin/The following command is copied to the path that is already a global system command/usr/local/sbin #
Source/etc/profile
Echo $PATH
MySQL Test login, default no password
mysqladmin-u root password ' ye123456 ' Set root password
Configure MySQL to be secure after the root password is set
Note: You need to add permissions to this directory if you are prompted for the can ' t crate file '/tmp/* ' Chmod-r 1777/tmp/
MYSQL-5.5 Binary Package Installation