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

How to install and configure Mysql for Linux with rpm

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

Share

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

This article mainly explains "how to install and configure Mysql for Linux with rpm". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install and configure Mysql for Linux in rpm".

1. Preparation and installation

1) download the rpm installation package (or rpm bundle)

The rpm installation package includes two (there will be more bundle), one is client and the other is server, for example: MySQL-client-5.5.44-1.linux2.6.i386.rpmash MySQL Musservermi 5.5.44-1.linux2.6.i386.rpm.

2) upload rpm (bundle) installation package

Upload the two downloaded rpm installation packages to the / usr/local/ directory.

3) detect and delete previously installed rpm packages

# rpm-qa | grep mysql

# rpm-e-nodeps qt-mysql-4.6.2-26.el6_4.x86_64

# rpm-e-nodeps mysql-server-5.1.71-1.el6.x86_64

# rpm-e-nodeps mysql-libs-5.1.71-1.el6.x86_64

# rpm-e-nodeps mysql-devel-5.1.71-1.el6.x86_64

# rpm-e-nodeps mysql-5.1.71-1.el6.x86_64

4) install the rpm installation package

# rpm-ivh MySQL-server-5.5.44-1.linux2.6.i386.rpm

# rpm-ivh MySQL-client-5.5.44-1.linux2.6.i386.rpm

Note:

If you install rpm bundle, you need to unpack and install the following rpm package.

1) decompress the tar package

# tar-xvf mysql-8.0.12-1.el6.x86_64.rpm-bundle.tar

2) install the decompressed rpm package in sequence

# rpm-ivh mysql-community-common-8.0.12-1.el6.x86_64.rpm

# rpm-ivh mysql-community-libs-8.0.12-1.el6.x86_64.rpm

# rpm-ivh mysql-community-libs-compat-8.0.12-1.el6.x86_64.rpm

# rpm-ivh mysql-community-client-8.0.12-1.el6.x86_64.rpm

# rpm-ivh mysql-community-server-8.0.12-1.el6.x86_64.rpm

4) copy and modify configuration files

# cp / usr/share/mysql/my-medium.cnf / etc/my.cnf

Then, add the following variables to the / etc/my.cnf configuration file.

[client]

Default-character-set=utf8

[mysqld]

Default-storage-engine=INNODB

Character-set-server=utf8

Collation-server=utf8_generic_ci

5) start mysql

# service mysql start

two。 Management and configuration

1) modify login password

# / usr/bin/mysqladmin-u root password 'new-passwd'

Note:

1) it should be noted that before mysql5.7.4, the default root after installation does not have a password. After that, the password can be obtained through mysqld.log. The location of the specific mysqld.log depends on the specific settings, such as / var/log/mysqld.log,/usr/local/mysql/mysqld.log, etc. It can be obtained with the following command:

Cat mysqld.log | grep pass

2) start and stop mysql

# / etc/init.d/mysql start

# / usr/bin/mysqladmin-u root-p shutdown

# sudo / etc/init.d/mysql restart

3) self-startup configuration

# chkconfig-list

# chkconfig-del mysql

# chkconfig-add mysql

# chkconfig mysql on

4) when a mysql user starts or stops a mysql database, an error of permission problem may occur. You can set relevant variables according to the specific situation, such as:

Datadir,socket,log-error,pid-file et al. In addition, there may be permission errors about the / var/lock/subsys/mysql path, which cannot be modified by modifying the mysql variable, but can be changed by modifying the lockfile in the / etc/init.d/mysqld script.

Thank you for your reading, the above is the content of "how to install and configure Mysql for Linux with rpm". After the study of this article, I believe you have a deeper understanding of how to install and configure Mysql for Linux in rpm. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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