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 are the three installation methods in mysql

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces which three installation methods of mysql, have certain reference value, interested friends can refer to, hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

Three ways to install mysql: RPM binary package and source code

The system platform installed this time is redhat 5

First, use RPM package for installation

First of all, you can download the corresponding version of the rpm package from the installation CD or to the website of mysql as follows:

MySQL-server-community-5.1.38-0.rhel5.i386.rpm

MySQL-client-community-5.1.38-0.rhel5.i386.rpm

Then we can use the rpm command to install:

Rpm-ivh MySQL-server-community-5.1.38-0.rhel5.i386.rpm

Rpm-ivh MySQL-client-community-5.1.38-0.rhel5.i386.rpm

Install the binary package

The steps are as follows:

1. Log in to the system with root and add mysql users and groups

Groupadd mysql

Useradd-g mysql mysql

2. Decompress the binary package. If the binary package is placed under / home/mysql, we will add a symbolic link after decompression.

Tar xvfz mysql-5.1.38-linux-i686-glibc23.tar.gz

Ln-s mysql-5.1.38-linux-i686-glibc23 mysql

3. Create the tables of the system database under the database directory-- user indicates that the owner of these databases and tables is the user

Cd mysql

. / scripts/mysql_install_db-- user=mysql

4. Set directory permissions, change the owner of data directory to mysql, and the owner of files in other directories to root

Chown-R root:mysql.

Chown-R mysql:mysql data

5. Start mysql

. / bin/mysqld_safe-- user=mysql &

3. Install mysql with source code

1. Log in to the system with root and add mysql users and groups

Groupadd mysql

Useradd-g mysql mysql

2. Decompress the source code package and enter the decompressed directory

Tar xvfz mysql-5.1.38.tar.gz

Cd mysql-5.1.38

3. Use the configure tool to compile the source code. Here we can use many parameters, which can be checked with configure-- help. Here we install mysql under / usr/local/mysql.

. / configuer-- prefix=/usr/local/mysql

Make

Make install

4. Select a sample configuration file and copy it to / etc/ and rename it to my.cnf

Cp support-files/my-medium.cnf / etc/my.cnf

5. Create the tables of the system database under the database directory-- user indicates that the owner of these databases and tables is the user

Cd / usr/local/mysql

. / bin/mysql_install_db-- user=mysql

6. Set directory permissions to change the owner of the var directory to mysql, and the owner of other directories and files to root

Chown-R root.

Chown-R mysql var

Chgrp-R mysql.

7. Start mysql

. / bin/mysqld_safe-- user=mysql &

Thank you for reading this article carefully. I hope the article "what are the three installation methods of mysql" shared by the editor will be helpful to you? at the same time, I also hope you can support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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