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

Linux WEB Server Building-MySql

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

Share

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

Using source code installation, some parameters can be added according to the actual production environment to improve the performance of mysql.

Mysql official website https://www.mysql.com/

This article uses version 5.1 dedicated installation instructions, the later version such as 5.5 installation method will be somewhat different, it is also used in some production environments of the company

Version 5.1 mysql.

Download the mysql source code

Decompress tar zxf mysql-5.1.72.tar.gz

Cd mysql-5.1.72

Configuration

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

-- with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock\

-- localstatedir=/usr/local/mysql/data\

-- enable-assemble\

-- enable-thread-safe-client\

-- with-mysqld-user=mysql\

-- with-big-tables\

-- with-pthread\

-- with-extra-charsets=complex\

-- with-readline\

-- with-ssl\

-- with-mysqld-ldflags=-all-static\

-- with-client-ldflags=-all-static

[root@backupserver mysql-5.1.72] #. / configure-- help to view specific configuration parameters

Make&&make install

The development test template is used here

/ bin/cp support-files/my-small.cnf / etc/my.cnf

Create a database file

Mkdir-p / usr/local/mysql/data

Chown-R mysql / usr/local/mysql authorized mysql users can access the mysql directory

/ usr/local/mysql/bin/mysql_install_db-- user=mysql installs mysql database files

After installation, there will be some instructions, such as how to start and so on.

Installation instructions method to start mysql

/ usr/local/mysql/bin/mysqld_safe/usr/local/mysql/bin/mysqld_safe & & indicates running in the background

To start mysql more conveniently, you can add mysql to the global variable

Add mysql to the global variable echo 'export PATH=$PATH:/usr/local/mysql/bin' > > / etc/profile

Source / etc/profile

Execute mysql to enter the database

[root@backupserver mysql-5.1.72] # mysql

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 1

Server version: 5.1.72 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

Configure / etc/init.d/mysqld to start mysql

Cp support-files/mysql.server / etc/init.d/mysqld

Chmod 700 / etc/init.d/mysqld Authorization

Add mysql service to boot

[root@backupserver mysql-5.1.72] # chkconfig-- add mysqld

[root@backupserver mysql-5.1.72] # chkconfig mysqld on

Mysql enters the database

Set the password set password for root@localhost=PASSWORD ('123456')

Then enter the mysql database in the form of mysql-uroot-p

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