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 deploy MySQL on Linux

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article is about how MySQL is deployed on Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Configure SQL

1. Download the SQL package from windows to Linux using yum

Command rz to find the tar package of SQL to upload

two。 Check whether it is installed.

By checking the process ps-ef | grep mysqld

By checking whether rpm-qa exists | grep-I mysqld

3. Install and rename

Tar installs tar package tar-xzvf mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz

Mv changed his name to mv mysql-5.6.23-linux-glibc2.5-x86_64 mysql

4. Create users and user groups

5. Configure personal environment variables for the following steps

[root@sht-sgmhadoopnn-01 local] # cp / etc/skel/.* / usr/local/mysql

Cp: omitting directory `/ etc/skel/.'

Cp: omitting directory `/ etc/skel/..'

Cp: omitting directory `/ etc/skel/.mozilla'

6. Create / etc/my.cnf

Use the vi command to create vi / etc/my.cnf and then gg to enter the first line, dG to empty the file contents, copy and paste into the configuration contents (remember to enter insert)

7. Change the users, user groups, and permissions of the my.cnf file

Use chown to change the users and user groups of files

Use chomd to change the permissions of a file

8. Change the users, groups, and permissions of the folder / usr/local/mysql

9. First installation

Enter the instruction scripts/mysql_install_db-user=mysqladmin-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data as shown in the figure:

10. Copy the file to ini.d and rename it

Cp support-files/mysql.server / etc/rc.d/init.d/mysql is shown in the figure:

11. Give executable permissions

Chmod + x / etc/rc.d/init.d/mysql

twelve。 Add Servic

Chkconfig-add mysql

13. Set permissions

Chkconfig-level 345 mysql on

14. Modify content

Vi / etc/rc.local:

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