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

Mysql installation detailed process, tar mode

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

Share

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

1. Create mysql users and mysql user groups

Groupadd mysql

Useradd-r-g mysql mysql

2. Download the mysql-5.7.17 package from my shared network disk

Link: http://pan.baidu.com/s/1gfAA87p password: iuti

3. Copy the downloaded installation package to the linux system, and you can use sftp or share the network disk

Tar-zxvf mysql-5.7.17-linux-glibc2.5-x86_64

Cp mysql-5.7.17-linux-glibc2.5-x86_64 / opt/mysql

4. Create a data directory

Mkdir / usr/local/mysql/data

5. Install the database

Change to / usr/local/mysql directory

Cd / usr/local/mysql

Change the owner of the current directory to the mysql user

Chown-R mysql:mysql. /

Install the database

Bin/mysqld-initialize-user=mysql-basedir=/opt/mysql-datadir=/opt/mysql/data

If prompted for missing libaio.so installation libaio, execute the above installation command

Yum-y install libai*

Successful installation will be prompted as follows, where nZ*tjVcD?6NC is the password

2017-05-09T03:38:34.197041Z 1 [Note] A temporary password is generated for root@localhost: nZ*tjVcD?6NC

6. Execute the following command to create RSA private key

Bin/mysql_ssl_rsa_setup-datadir=/usr/local/mysql/data

7. Change the current user owner to root

Chown-R root:root. /

Change the current data directory owner to mysql

Chown-r mysql:mysql. / data

8. Modify my.cnf and boot

Cd support-filessudo

Cp my-default.cnf / etc/my.cnfsudo

Cp mysql.server / etc/init.d/mysqlsudo

Vim / etc/init.d/mysql

# # modifying the basedir=/usr/local/mysql installation directory

# # modifying the datadir=/usr/local/mysql/data installation directory

9. Modify my.cnf

Vim / etc/my.cnf

[mysqld]

Character-set-server=utf8

Datadir=/usr/local/mysql/data

Basedir=/usr/local/mysql

Socket=/var/lib/mysql/mysql.sock

[client]

Socket=/var/lib/mysql/mysql.sock

Create a directory

Mkdir-p / var/lib/mysql/

Chown-R mysql:mysql / var/lib/mysql

10. Change the environment variable to the default directory of mysql

Vim / etc/profile

Export MYSQL_HOME= "/ opt/mysql"

Export PATH= "$PATH:$MYSQL_HOME/bin"

Start mysql

Service mysql start

11. Change the mysql password

Mysqladmin-u root-p 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