LNMP installation of mysql5.7.17

Source: Internet
Author: User
Tags openssl mysql login openldap

Execute the command first yum install CMake

mysql5.7 with CMake installation (more advanced configure)

wget Download catalogue (download to the mirror station of Tsinghua University)

[Email protected] local]# CD/USR/LOCAL/SRC

[Email protected] src]# wget https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/mysql-5.7.17.tar.gz

unzip [[email protected] src]# tar vfxz mysql-5.5.17.tar.gz

[Email protected] src]# cd/usr/local/src/mysql-5.5.17

To prevent errors due to missing things, now integrate the installation

Yum-y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel
FreeType freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-
Devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel Curl curl-
Devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel OpenSSL
Openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-
Servers gd gd2 gd-devel gd2-devel Perl-cpan pcre-devel

Then execute the following command:

[Email protected] mysql-5.5.17]# cmake \
-dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/usr/local/mysql/data \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci

Ok,cmake Compilation succeeded

Execute make && make install again

Time is slightly longer (15 minutes), waiting patiently ...

configuring MySQL Files

Check First:

[email protected] mysql-5.5.17]# CP support-files/my-medium.cnf/etc/my.cnf
CP: Do you want to overwrite "/etc/my.cnf"? Y
[[email protected] mysql-5.5.17]# useradd MySQL

[Email protected] mysql-5.5.17]# chmod +x/usr/local/mysql

[Email protected] mysql-5.5.17]# chown-r mysql.mysql/usr/local/mysql

Initializing MySQL Database

[Email protected] mysql-5.5.17]#/usr/local/mysql/scripts/mysql_install_db \
--user=mysql \
--basedir=/usr/local/mysql \
--datadir=/usr/local/mysql/data &

Change the MySQL directory owner from MySQL to root

[Email protected] local]# chown-r root/usr/local/mysql

Change the owner of the MySQL directory from root to MySQL

[Email protected] local]# chown-r mysql/usr/local/mysql/data

Running the MySQL service

[Email protected] mysql]#/usr/local/mysql/bin/mysqld_safe--user=mysql &

Crtl+c exit

To see if it started successfully

It started, hey.

Test a MySQL

[Email protected] bin]#/usr/local/mysql/bin/mysql

Set MySQL login username and password

First, delete the anonymous user:

Ok, leave a root user, OK

Then change the password for the root account

And the last step, refresh the permission so that it takes effect immediately

Come on, test whether a piece is in effect

OK, it's done!

LNMP installation of mysql5.7.17

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.