CentOS 6.5 binary installation MySQL 5.6

Source: Internet
Author: User

CentOS 6.5 binary installation MySQL 5.6

--------------------------------


Download MySQL5.6 binary Package

Mysql-5.6.20-linux-glibc2.5-x86_64.tar.gz



Install dependent packages

Yum Install libaio*

Useradd MySQL


Install MySQL under/data/mysql/data


Tar zxvf mysql-5.6.20-linux-glibc2.5-x86_64.tar.gz-c/data/

MV Mysql-5.6.20-linux-glibc2.5-x86_64 MySQL



Modify all levels of MySQL folder and file creator, create the group as MySQL (note that there is one behind the statement.)


Chown-r Mysql.mysql/data/mysql


Now that MySQL is installed,

But it also requires initialization, initializing MySQL tables, test tables, infomation tables, and so on.


/data/mysql/scripts/mysql_install_db--datadir=/data/mysql/data--basedir=/data/mysql--user=mysql--explicit_ Defaults_for_timestamp

--------------------------------------------------------------------------------------------------------------- ----------------------


Copy Startup scripts

Cp/data/mysql/support-files/mysql.server/etc/init.d/mysqld

 

Ln-s/data/mysql/include/usr/include/mysql


echo "/data/mysql/lib" >/etc/ld.so.conf.d/mysql.conf && ldconfig-v


Ln-s/data/mysql/bin/mysql/usr/bin



Modifying a configuration file my.cnf


Cd/data/mysql

CP MY.CNF/ETC/MY.CNF


Vim/etc/my.cnf


added in [mysqld]:

Basedir =/data/mysql

DataDir =/data/mysql/data

Port = 3306

server_id = 1


-------------------------


Start the MySQL service


Chkconfig mysqld on

Service mysqld Start

  


Log in to MySQL and delete empty users

Mysql


Mysql> SELECT User,host,password from Mysql.user;

+------+-----------------------+----------+

| user | Host | password |

+------+-----------------------+----------+

| Root |          localhost | |

| Root |          Localhost.localdomain | |

| Root |          127.0.0.1 | |

| Root |          :: 1 | |

| |          localhost | |

| |          Localhost.localdomain | |

+------+-----------------------+----------+

6 rows in Set (0.00 sec)

Set password () in parentheses for password, username root

mysql> UPDATE mysql.user Set password = password (' [email protected] ') WHERE user = ' root ';


Mysql> SELECT User,host,password from Mysql.user;


+------+-----------------------+-------------------------------------------+

| user | Host | password |

+------+-----------------------+-------------------------------------------+

| Root | localhost | *11b9aca21786f766739d0eb1483c5f64212b81ac |

| Root | Localhost.localdomain | *11b9aca21786f766739d0eb1483c5f64212b81ac |

| Root | 127.0.0.1 | *11b9aca21786f766739d0eb1483c5f64212b81ac |

| Root | :: 1 | *11b9aca21786f766739d0eb1483c5f64212b81ac |

| |                                           localhost | |

| |                                           Localhost.localdomain | |

+------+-----------------------+-------------------------------------------+

6 rows in Set (0.00 sec)



mysql> DROP USER ' @localhost;

mysql> FLUSH privileges;


Mysql> quit


---------------------MySQL Installation complete-------------------------------


Set/Modify Password

Mysql> Grant all privileges on * * to ' root ' @ ' localhost ' identified by ' [email protected] ' with GRANT option;

mysql> flush Privileges;

















  


CentOS 6.5 binary installation MySQL 5.6

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.