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

Detailed steps of installing mysql under Linux system

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

Share

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

This article introduces the relevant knowledge of "the detailed steps of installing mysql under the Linux system". In the operation of the actual case, many people will encounter this dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Install mysql

/ / upload mysql-5.0.221.tar.gz to the path: / mnt/disk1/program and install

Tar-xzvf mysql-5.0.221.tar.gz

Cd mysql-5.0.22

# create a new folder

Mkdir / mnt/disk1/program/mysql

# create a group / etc vi group

Groupadd mysql

# create a user / home under the group

Useradd-g mysql mysql

# configure path

. / configure-prefix=/mnt/disk1/program/mysql-with-pic-with-fPIC can be omitted

# installation project files

Make clean

# compilation project

Make

# install project files to the system

Make install

# / mnt/disk1/program/mysql-5.0.22/scripts/ mysql_install_db

#

# initialize the authorization list, including the following permission sets

The # MySQL root user is created as a superuser who can do anything. The connection must be made by the local host.

# the born root password is empty, so anyone can connect with root without a password and give all permissions.

#

. / scripts/mysql_install_db

# / change the owner and group of all files in mnt/disk1/program/mysql/ to user root

Chown-R root / mnt/disk1/program/mysql/

# / change the owner and group of all files in mnt/disk1/program/mysql/ var/ to user mysql

Chown-R mysql/ mnt/disk1/program/mysql/var/

# change the user group to which the file belongs

Chgrp-R mysql/ mnt/disk1/program/mysql/

# at this point, the mysql installation is complete and you are ready to start

/ mnt/disk1/program/mysql/bin/mysql

# exit quit

Quit

# copy / mnt/disk1/program/mysql-5.0.22/support-files/my-huge.cnf to / etc/my.cnf

Cp support-files/my-huge.cnf / etc/my.cnf

Cp / mnt/disk1/program/mysql/share/mysql/mysql.server / etc/init.d/mysql

# start mysql

/ mnt/disk1/program//bin/mysqld_safe-user=mysql &

# mysql set password

/ mnt/disk1/program/mysql/bin/mysqladmin-u root password''

# soft link to / sbin/mysql

Ln-s / mnt/disk1/program/mysql/bin/mysql / sbin/mysql

# soft link to / sbin/mysqladmin

Ln-s / mnt/disk1/program/mysql/bin/mysqladmin / sbin/mysqladmin

# start and stop the service

Service mysql start

Service mysql stop

# restart the service

Service mysql restart

Service mysqld status

This is the end of the detailed steps for installing mysql under the Linux system. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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: 241

*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