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

36 classes (introduction to LAMP architecture, introduction to MySQL, MariaDB, MySQL installation)

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

11.1 LAMP Architecture Introduction

LAMP is an abbreviation, it contains four things for Linux, Apache, MySQL, PHP for LAMP, linux is the operating system, Apache is the external service software, MySQL is a soft storage, php is the language

11.2 MySQL, MariaDB Introduction

11.3/11.4/11.5 MySQL Installation

Use binary compile-free installation package to explain:

cd /usr/local/src

wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz

tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz

mv mysql-5.6.36-linux-glibc2.5-x86_64 /usr/local/mysql

The requested URL/usr/local/mysql/was not found on this server.

The above figure shows an error message. There is a module missing. The module name is Dumper. I don't know which package depends on it. I can only search for it vaguely as follows.

cp support-files/my-default.cnf /etc/my.cnf

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

vi /etc/init.d/mysqld

The following picture needs to be modified

Change of Authority 755

startup

Start up with the command.

Stop MySQLd

Another way to start is as follows,

Extended MYSQL5.5 source code installation under linux

Install the necessary libraries first

yum -y install gcc*

install MySQL

Install camke first

I. Support YUM, then

yum install -y cmake

Second, you can also install the source code

cd /usr/local/src

#Download cmake

wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz

tar zxvf cmake-2.8.7.tar.gz

cd cmake-2.8.7

#Install cmake

./ configure

make

make install

install MySQL

MYSQL5.5 version Linux source package download official website

http://dev.mysql.com/downloads/

installation

groupadd mysql

useradd -g mysql mysql

tar zxvf mysql-5.2.25.tar.gz

cd mysql-5.2.25

#cmake . //By default, the installation directory is/usr/local/mysql The data directory is/usr/local/mysql/data

#You can also specify parameter installation, such as specifying UTF8, data engine, etc.

#See http://www.example.com for details... dev.mysql.com/doc/refman/ ration-options.html

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0 -DWITH_SSL=yes -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1

make && make install

cd /usr/local/mysql

chown -R mysql:mysql /usr/local/mysql

./ scripts/mysql_install_db --user=mysql -datadir=/mysql/data

#If datadir is not specified here, an error will be reported when starting

chown -R root .

chown -R mysql data

cp support-files/my-medium.cnf /etc/my.cnf

bin/mysqld_safe --user=mysql &

Next command is optional

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

chmod +x /etc/init.d/mysqld

/etc/init.d/mysqld start

Here, installation is complete

mysql5.7 binary package installation download package

wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz

If this link fails, please go to r.aminglinux.com for the latest download address.

decompression

tar xxvf mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz

mv mysql-5.7.12-linux-glibc2.5-x86_64 /usr/local/mysql

initialization

useradd -M -s /sbin/nologin mysql

mkdir -p /data/mysql

chown mysql /data/mysql

cd /usr/local/mysql

./ bin/mysqld --initialize --user=mysql --datadir=/data/mysql

Notice that there's a hint at the end of this step.

[Note] A temporary password is generated for root@localhost: Bs1i(,kXwg

The last string is the root password.

./ bin/mysql_ssl_rsa_setup --datadir=/data/mysql

Copy configuration files and startup scripts

cp support-files/my-default.cnf /etc/my.cnf

vim /etc/my.cnf //Edit or modify

basedir = /usr/local/mysql

datadir = /data/mysql

port = 3306

socket = /tmp/mysql.sock

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

vi /etc/init.d/mysqld //Edit or modify

basedir=/usr/local/mysql

datadir=/data/mysql

start the service

/etc/init.d/mysqld start

Set root password

Log in with initialization password

/usr/local/mysql/bin/mysql -uroot -p'Bs1i(,kXwg' //enter and set password directly

mysql>set password = password ('mypass '); //be sure to set a new password

Log out and log in with a new password.

There is also a case where the initialization password is not known.

vi /etc/my.cnf

Add a line below [mysqld]

skip-grant-tables

The requested URL/etc/init.d/mysqld/was not found on this server.

/usr/local/mysql/bin/mysql -uroot

mysql> update user set authentication_string=password('123333') where user='root';

After exiting, change my.cnf and remove the skip-grant-tables just added.

The requested URL/etc/init.d/mysqld/was not found on this server.

The new password can now be used.

extended

mysql5.5 source code compilation installation http://www.aminglinux.com/bbs/thread-1059-1-1.html

mysql5.7 binary package installation (large changes) http://www.apelearn.com/bbs/thread-10105-1-1.html

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