MySQL binary installation method on Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.