Build groups, build users:
[[email protected] mysql]# Groupadd MySQL
[[email protected] mysql]# useradd-g MySQL MySQL
Unzip the installer:
[Email protected] mysql]# TAR-ZXVF mysql.tar.gz
[Email protected] mysql]# Mv/rpm/mysql/usr/local/mysql
Initialization
[Email protected] mysql]#/scripts/mysql_install_db--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/data/- -user=mysql
Configuration file:
[Email protected] mysql]# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF
Basedir =/usr/local/mysql
DataDir =/usr/local/mysql/data
Port = 3306
Log_error=mysql.err
Modify Directory Permissions:
[Email protected] mysql]# chown-r mysql:mysql/usr/local/mysql/
To modify an environment variable:
Export Path=/usr/local/mysql/bin: $PATH
Start the database:
[Email protected] ~]$/usr/local/mysql/bin/mysqld--user=mysql &
Or
[Email protected] ~]$/usr/local/mysql/bin/mysqld_safe--user=mysql &
Set MySQL boot to start automatically:
[Email protected] mysql]# Cp/usr/local/mysql/support-files/mysql.server/etc/rc.d/init.d/mysqld
[Email protected] mysql]# chown-r root:root/etc/rc.d/init.d/mysqld
[Email protected] mysql]# chmod 755/etc/rc.d/init.d/mysqld
[Email protected] mysql]# chkconfig--add mysqld
[Email protected] mysql]# chkconfig--list mysqld
Mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[[Email protected] mysql]# service mysqld status
error! MySQL is not running
Root User license for MySQL:
Mysql> Grant all privileges on * * to ' root ' @ '% ' identified by ' Oracle ';
Query OK, 0 rows Affected (0.00 sec)
mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)
mysql> set password for ' root ' @ '% ' =password (' Oracle ');
Query OK, 0 rows Affected (0.00 sec)
MySQL binary installation method on Linux