Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the installation of MySQL5.5 based on CentOS6 binaries?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

MySQL5.5 based on CentOS6 binary package installation is how to solve this problem, this article describes in detail the corresponding analysis and solutions, hoping to help more partners who want to solve this problem to find a more simple and easy way.

1. Background

* MySQL is a relational database management system developed by the Swedish company MySQL AB and currently under the umbrella of Oracle. MySQL is one of the most popular relational database management systems. In terms of WEB applications, MySQL is the best RDBMS (relational database management system) application software.

* MySQL is a relational database management system in which relational databases store data in different tables instead of all data in one large warehouse, which increases speed and flexibility.

* the SQL language used by MySQL is the most commonly used standardized language for accessing databases. MySQL software adopts the dual licensing policy, which is divided into community version and commercial version. Because of its small size, high speed and low total cost of ownership, especially open source, the development of small and medium-sized websites generally choose MySQL as the website database.

two。 The reason for choosing

* support multiple platforms [AIX, FreeBSD, HP-UX, Linux, Mac OS, OpenBSD, Solaris, Windows.]

* support and provide multilingual API

* Open source, using the GPL protocol, you can modify the source code to develop your own MySQL system

* support standard SQL statements

* multiple storage engines are supported

3. Environment

[root@mysql ~] # cat / etc/redhat-release CentOS release 6.6 (Final) [root@mysql ~] # uname-r2.6.32-504.el6.x86_64

4. Installation

* enter the package download directory

[root@mysql ~] # cd / usr/local/src/

* download MySQL binary package [mysql-5.5.53-linux2.6-x86_64.tar.gz]

[root@mysql src] # wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.53-linux2.6-x86_64.tar.gz

* unpack

[root@mysql src] # tar zxf mysql-5.5.53-linux2.6-x86_64.tar.gz

* move to the mysql installation directory

[root@mysql src] # mv mysql-5.5.53-linux2.6-x86_64 / usr/local/mysql-5.5.53

* create mysql soft links

[root@mysql src] # ln-s / usr/local/mysql-5.5.53 / usr/local/mysql

* enter the mysql directory

[root@mysql src] # cd / usr/local/mysql

* copy the mysql configuration file to the specified location

[root@mysql mysql] #\ cp support-files/my-medium.cnf / etc/my.cnf

* create mysql service users

[root@mysql mysql] # useradd-r-s / sbin/nologin-M mysql

* create a mysql data directory

[root@mysql mysql] # mkdir / data/mysql-p

* change the users and groups to which the data directory belongs

[root@mysql mysql] # chown mysql.mysql / data/mysql

* mysql initialization

[root@mysql mysql] # / scripts/mysql_install_db-- user=mysql-- basedir=/usr/local/mysql-- datadir=/data/mysqlInstalling MySQL system tables...170325 3:12:16 [Note] Ignoring-- secure-file-priv value as server is running with-- bootstrap.170325 3:12:16 [Note] / usr/local/mysql/bin/mysqld (mysqld 5.5.53-log) starting as process 8023... OKFilling help tables...170325 3:12:16 [Note ] Ignoring-- secure-file-priv value as server is running with-- bootstrap.170325 3:12:16 [Note] / usr/local/mysql/bin/mysqld (mysqld 5.5.53-log) starting as process 8031... OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER! To do so Start the server, then issue the following commands:/usr/local/mysql/bin/mysqladmin-u root password' new-password'/usr/local/mysql/bin/mysqladmin-u root-h mysql password' new-password'Alternatively you can run:/usr/local/mysql/bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.See the manual for more instructions.You can start the MySQL daemon with:cd / usr/local/mysql; / usr/local/mysql/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.plcd / usr/local/mysql/mysql-test; perl mysql-test-run.plPlease report any problems at http://bugs.mysql.com/

Seeing the above two OK proves that the initialization is successful.

5. Create a startup script

* copy the startup script to the service service management directory [/ etc/init.d]

[root@mysql mysql] # cp / usr/local/mysql/support-files/mysql.server / etc/init.d/mysqld

* modify mysql startup script [/ et/init.d/mysqld]

Basedir=/usr/local/mysqldatadir=/data/mysql

* add to service service management

[root@mysql mysql] # chkconfig-- add mysqld

6. Service startup test

Mysql started successfully

7. Service connection testing

[root@mysql mysql] # / usr/local/mysql/bin/mysql

Successful connection through mysql client

8. Set root password

[root@mysql mysql] # / usr/local/mysql/bin/mysqladmin-u root password '123456' this is the answer to the question about how MySQL5.5 is installed based on CentOS6 binaries. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report