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

One of the ways to install MYSQL

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

Share

Shulou(Shulou.com)06/01 Report--

Below to bring you one of the ways to install MYSQL, hope to give you some help in practical application, mysql involves more things, the theory is not much, there are many books online, today we use the accumulated experience in the industry to do an answer.

One of the ways to install MYSQL, which is much more convenient than source code package and rpm installation.

You can download the binary package directly to the official.

Need to uninstall mariadb first

Rpm-e mariadb-libs-- nodeps

Directly decompress, move

Tar zxf mysql-5.7.20-linux-glibc2.12-x86_64.tar.gzmv mysql-5.7.20-linux-glibc2.12-x86_64 / usr/local/mysql

Create users and groups

Groupadd mysqluseradd-r-g mysql-s / bin/false mysql

Edit the main configuration file (only meet startup, other configurations can be added on your own)

Echo [mysqld] > / etc/my.cnfecho socket=/tmp/mysql.sock > > / etc/my.cnfecho basedir=/usr/local/mysql > > / etc/my.cnfecho datadir=/usr/local/mysql/data > > / etc/my.cnf

Create a data directory and grant permissions

Mkdir / usr/local/mysql/datacd / usr/local/mysql/chmod 750datachown-R mysql. Chgrp-R mysql.

Add environment variabl

Echo "export PATH=$PATH:/usr/local/mysql/bin" > > / etc/profilesource / etc/profile

Initialization

Bin/mysqld-initialize-user=mysql

Some newly installed systems are lack of applications. Initialization will report errors and just yum.

Yum install libaio

Boot automatically and start up

Cp / usr/local/mysql/support-files/mysql.server / etc/init.d/mysqldsystemctl daemon-reloadsystemctl enable mysqlsystemctl start mysql

Set MYSQL password

Cd / usr/local/mysql/bin/mysqladmin-u root-p password 123456

After setting the password, you can log in normally. This method is recommended.

After reading one of the above methods of installing MYSQL, if there is anything else you need to know, you can find out what you are interested in in the industry information or find our professional technical engineer to answer, the technical engineer has more than ten years of experience in the industry.

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