Download MySQL and upload to the server
1. Download MySQL binary installation package on MySQL website
Https://edelivery.oracle.com/osdc/faces/SearchSoftware?_afrLoop=2326871189822158&_afrWindowMode=0&_ Adf.ctrl-state=hqkzyoa95_9
2. Upload to the server and unzip
TAR-XZVF mysql-advanced-5.6.26-linux-glibc2.5-x86_64.tar.gz
Create MySQL Account
Useradd MySQL
Install the required package for MySQL, Libaio
Yum Install libaio*
Place the extracted MySQL installation package in the specified installation location, change the owner to MySQL, and establish a soft connection for the MySQL folder (for ease of administration)
MV mysql-advanced-5.6.26-linux-glibc2.5-x86_64/app/
Chown-r mysql:mysql/app/mysql-advanced-5.6.26-linux-glibc2.5-x86_64
Ln-s./mysql-advanced-5.6.26-linux-glibc2.5-x86_64 MySQL
Install MySQL
Cd/app/mysql/scripts
./mysql_install_db--user=mysql--basedir=/app/mysql--datadir=/app/mysqldata
For ease of use, we configure the MySQL user's profile. Bash_profile, add the following
Export Mysql_home=/app/mysql
Export Path=${mysql_home}/bin:${path}
Configure MySQL
Copy the default profile to/ETC/MY.CNF and configure it
CP./SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF
Modify the content inside such as
Basedir=/app/mysql
Datadir=/app/mysqldata
Log_bin=/app/mysqllog/dbtest
Innodb_buffer_pool_size = 128M
Sql_mode=no_engine_substitution,strict_trans_tables
max_binlog_cache_size=67108864
max_binlog_size=2147483648
max_binlog_stmt_cache_size=67108864
binlog_cache_size=131072
Innodb_log_files_in_group=3
Innodb_log_group_home_dir=/app/mysql_innodb_log
Copy the MySQL management script to/ETC/INIT.D and make the necessary changes
CP Mysql.server/etc/init.d/mysql
Modify Basedir and DataDir
Basedir=/app/mysql
Datadir=/app/mysqldata
Create a connection to the MySQL service script in Rc{3,4,5}.d, as follows:
cd/etc/rc3.d | rc4.d | Rc5.d
[Email protected] rc3.d]# ln-s. /init.d/mysql S99mysql
[Email protected] rc3.d]# ln-s. /init.d/mysql K01mysql
S99mysql where s means system boot, 99 means start service order, and finally start service
K01mysql which k means to follow the system shutdown stop service, 01 means to stop the service order, first shut down
In the other two folders, perform the above steps sequentially
Use the Chkconfig command to add the service so that MySQL starts automatically as the system starts
[[email protected] rc5.d]# chkconfig--list|grep MySQL
MySQL 0:off1:off2:on3:on4:on5:on6:off
Change root password
1. Start the database with Mysqld_safe--skip-grant-tables, skip the authorization form, and modify the root user password
[Email protected] mysql]#/bin/mysqld_safe--user=mysql--datadir=/app/mysqldata--basedir=/app/mysql-- Skip-grant-tables
mysql> Update user Set Password=password (' 123456 ') where user= ' root ';
mysql> flush Privileges;
Restart the database to
This article is from the "Database Road" blog, make sure to keep this source http://dbaway.blog.51cto.com/7099215/1703495
MySQL Two-level package installation for RedHat Linux Enterprise6.4