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

The detailed process of installing mysql in binary source code package under Linux

2025-03-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "the detailed process of installing mysql under Linux binary source code package". In daily operation, I believe many people have doubts about the detailed process of installing mysql in binary source code package under Linux. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "the detailed process of installing mysql under Linux binary source code package". Next, please follow the editor to study!

Get the binary source code ready before installation, which can be downloaded from Sohu image: http://mirrors.sohu.com/

I prepared mysql-5.5.15-linux2.6-i686.tar.gz, Linux version 2.6.18-164.el5

There may be some differences between the actual work and the configuration of the virtual machine.

=

Note: mysql installation must be specified to / usr/local must be named mysql

Binary source code installation needs to be run in the installation directory / usr/local

The code is as follows:

/ / create a user mysql

* groupadd-g 3306 mysql

* useradd-g mysql-u 3306-M mysql

* id mysql

* chown-R mysql:mysql / mydata/ mysql must have write permission to the directory

* ll-d / mydata/

* cp / mysql-5.5.15-linux2.6-i686 / usr/local

* cd / usr/local/mysql / / start initializing mysql

* chown-R mysql:mysql.

* ln-sv / mysql-5.5.15-linux2.6-i686 mysql

* scripts/mysql_install_db-user=mysql-datadir=/mydata/data

/ / scripts script initialization is used to generate mysql database database to store source data information such as tables.

The code is as follows:

/ / after the installation is completed, the following configuration starts

* ls support-files/ prepare the service startup script

* cp support-files/mysql.server / etc/init.d/mysqld / / put into init.d

* chkconfig-- add mysqld / / join the list of services

* chkconfig-- list mysqld / /-- list display

The code is as follows:

/ / you can start mysql at this time, but you still need to configure mysql

* ls / etc/my.cnf

* ls support-files/

* cp support-files/my-large.cnf / etc/my.cnf

* vim / etc/my.cnf

[mysqld] / / find the segment and add datadir = / mydata/data

Datadir = / mydata/data

* service mysqld start / / enable the service

* Port netstat-tnl / / 3306 is open

* echo $PATH

* / usr/local/mysql/bin/mysql

* export PATH=$PATH:/usr/local/mysql/bin / / Note: if you don't add $, only the path you added is left.

* vim / etc/profile / / add the following path before export

PATH=$PATH:/usr/local/mysql/bin / / permanent path configuration method

* mysql / / mysql is ready to start at this time

The code is as follows:

/ / path configuration of mysql library files

* ls

* vim / etc/ld.so.conf / / modify the location of the library file

* configuration of vim / etc/ld.so.conf.d/mysql.conf / / specifications can be configured in the current directory that ends with .conf.

* ldconfig-v | grep mysql / / the path to reload all library files does not have mysql library files

Vim / etc/ld.so.conf.d/mysql.conf

/ usr/local/mysql/lib / / New mysql.conf file to add these contents to the file

* ldconfig-v | grep mysql / / reload after modification, otherwise the server will not know

/ / path configuration of mysql library files

* ls

* vim / etc/ld.so.conf / / modify the location of the library file

* configuration of vim / etc/ld.so.conf.d/mysql.conf / / specifications can be configured in the current directory that ends with .conf.

* ldconfig-v | grep mysql / / the path to reload all library files does not have mysql library files

Vim / etc/ld.so.conf.d/mysql.conf

/ usr/local/mysql/lib / / New mysql.conf file to add these contents to the file

* ldconfig-v | grep mysql / / reload after modification, otherwise the server will not know

The code is as follows:

/ / configuration of header files

What are the functions of the library file and how to call them when others write the program? what is the parameter type? what is the return value type? you must find the header file corresponding to the library file. The corresponding header file is in / usr/include.

* ls / usr/include/

* output of ln-sv / usr/local/mysql/include / usr/include/mysql / / header file

* vim / etc/man

* vim / etc/man.config / / add Man

MANPATH / usr/local/mysql/man

OK! Mysql configured successfully

At this point, the study of "the detailed process of installing mysql in the binary source package under Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report