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

Linux installation mysql 5.7

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

Share

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

Mysql installation pits, different versions may use different commands, you need to check carefully here.

Download the corresponding linux version on the mysql official website as required.

two。 Create the mysql directory and install the downloaded installation package into the directory

Mkdir / usr/local/mysql

Tar-xvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz

Mv mysql-5.7.17-linux-glibc2.5-x86_64/* / usr/local/mysql/

Since there is no data folder, you need to create a / usr/local/mysql/data directory to modify permissions.

Mkdir / usr/local/mysql/data

Groupadd mysql

Chown-R mysql.mysql / usr/local/mysql/

Initialize data in the mysql directory

Bin/mysql_install_db-- user=mysql-- basedir=/usr/local/mysql/-- datadir=/usr/local/mysql/data/ copy the configuration file to / etc/my.cnf

Cp-a. / support-files/my-default.cnf / etc/my.cnf

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

6. Start the service

Service mysqld start

The login password can be checked by the command "cat / root/.mysql_secret"

7. Modify the password

SET PASSWORD FOR 'root'@localhost=PASSWORD (' 123456')

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