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 install mysql under linux

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

Share

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

This article mainly introduces how to install mysql under linux, which is very detailed and has a certain reference value. Friends who are interested must finish reading it!

1. Sudo apt-get install gathers + gcc make automake perl libncurses5-dev

Kdelibs_dev kdelib

(make sure the required tools are properly installed)

2. Cd ~ / Downloads

(enter the directory where the package is located)

3 、 tar zxvf mysql-6.0.2-alpha.tar.gz

(unzip it here)

4 、 cd mysql-6.0.2-alpha

(enter the unzipped source package folder)

5. / configure-- prefix=/usr/local/mysql

(specify installation path)

6 、 make

(compile installer)

7 、 sudo make install

(for installation)

8 、 sudo cp support-files/my-medium.cnf / etc/my.cnf

(copy the settings file in the source package to the unified settings file path of the / etc/ system)

9. Sudo ln-s / usr/local/mysql/bin/mysql / usr/bin/

Sudo ln-s / usr/local/mysql/bin/mysqladmin / usr/bin/

Sudo ln-s / usr/local/mysql/bin/mysqld_safe / usr/bin/

Sudo ln-s / usr/local/mysql/bin/mysql_conf / usr/bin/

Sudo ln-s / usr/local/mysql/share/mysql/mysql.server / usr/bin/

(add a soft link to execute the program, this is only for convenience, you don't have to do it if you prefer to use the full path.)

10 、 sudo groupadd mysql

(create user group mysql)

11. Sudo useradd-g mysql mysql

(create a user mysql under the user group mysql)

12 、 cd / usr/local/mysql

(enter the main program directory)

13. Sudo bin/mysql_install_db-user=mysql

(if you do not already have an installed MySQL, you must create an MySQL authorization table. After creation, you need to restart manually

Server)

14. Sudo chown-R root.

(make all files in the / usr/local/mysql/ directory owned by the root user root)

15. Sudo chown-R mysql:mysql var

(make all files in the / usr/local/mysql/var/ directory owned by the user mysql)

16. Sudo chgrp-R mysql.

(make all files in the / usr/local/mysql/ directory owned by the user group mysql)

17. Sudo bin/mysqld_safe-user=mysql &

(initialize and test your mysql, where & means background execution)

18.sudo netstat-tap | grep mysql

# check the service status from the service startup MySql

19.sudo ps a | grep mysql to check whether there is a mysql in the process

2. Start Mysql Server

Mysql_config

Or

Mysqld_safe-- user=mysql &

Or

Mysql.server start

Third, set up self-startup

1 、 sudo cp / usr/local/mysql/share/mysql/mysql.server / etc/init.d/mysql

2. Sudo chmod + x mysql

3. Sudo chkconfig-add mysql

4. Sudo sysv-rc-conf service management tool, you can open the service manually

Add Mysql user password

1. Make sure that Mysql Server is started

2. Mysql-u root-p

3. SET PASSWORD FOR 'root'@'localhost' = PASSWORD (' newpwd')

4. SET PASSWORD FOR 'root'@'hostname' = PASSWORD (' newpwd')

(hostname is your hostname, depending on the situation.)

The above is all the contents of the article "how to install mysql under linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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