Binary installation mariadb

Source: Internet
Author: User
Tags mysql create mysql delete

CentOS 7.3 Binary Installation mariadb10.2.8

1 , Make sure there is no database installed, there is a Lib library okay

Rpm-qa mariadb*

650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M01/A7/04/wKioL1nfJ52iCbubAAAReMPEJCM671.jpg "style=" float : none; "title=" image 1.jpg "alt=" Wkiol1nfj52icbubaaarempejcm671.jpg "/>

2 , See if there is a MySQL user, some words will be used userdel-r MySQL Delete, no words created.

Getent passwd MySQL to see if a MySQL user exists

useradd-d/app/mysqldb-r-m-s/sbin/nologin mysql Specify home directory, future storage database.

When creating a system user and specifying a home directory, you need to add-m to enforce the specified

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/08/4D/wKiom1nfKlWxU5_uAAAtvyxIXEE027.jpg "title=" Picture 2.jpg "style=" Float:none; "alt=" wkiom1nfklwxu5_uaaatvyxixee027.jpg "/>

3. Importing packages and unpacking

RZ mariadb-10.2.8-linux-x86_64.tar.gz

Tar xvf mariadb-10.2.8-linux-x86_64.tar.gz-c/usr/local/

Specifies that the/usr/local/path must be specified

cd/usr/local/

Ln-s Mariadb-10.2.8-linux-x86_64/mysql Specifies that the name must be called MySQL, so either rename it or create a soft link

4. Create and edit a configuration file

mkdir/etc/mysql/

Cp/usr/local/mysql/support-files/my-huge.cnf/etc/mysql/my.cnf

VIM/ETC/MYSQL/MY.CNF Modify the configuration file to tell the database which path I specified

[Mysqld]

DataDir =/APP/MYSQLDB Indicates the database storage path and must have this record

innodb_file_per_table = on database engine, specifying a single file per table for easy administration. Dispensable

Skip_name_resolve = on turns off name resolution and improves performance. Dispensable

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/08/4D/wKiom1nfKlWBm0oTAAAyDthEMCg552.jpg "title=" Picture 3.jpg "style=" Float:none; "alt=" wkiom1nfklwbm0otaaaydthemcg552.jpg "/>

5. Run the mysql_install_db script

cd/usr/local/mysql/remember not to go in scripts/, otherwise execution will fail

scripts/mysql_install_db--user=mysql--datadir=/app/mysqldb

To run the script, you need to indicate the user and database path

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/A7/04/wKioL1nfJ5_CpbfHAABmMUzBlsk975.jpg "title=" Picture 4.jpg "style=" Float:none; "alt=" wkiol1nfj5_cpbfhaabmmuzblsk975.jpg "/>

6. Place the service script in the specified path and rename it to mysqld for easy invocation with Systemctl

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

Chkconfig--add mysqld

Chkconfig--list mysqld

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/A7/04/wKioL1nfJ5-jZL-jAABsTkeehrs303.jpg "title=" Picture 5.jpg "style=" Float:none; "alt=" wkiol1nfj5-jzl-jaabstkeehrs303.jpg "/>

7. Create a log file

mkdir/var/log/mariadb/

Chown mysql/var/log/mariadb/

Service mysqld start automatically generates /var/log/mariadb/mariadb.log log Files

When you start, you'll see that port 3306 is turned on

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/08/4D/wKiom1nfKlWDbN44AABdQv43rA8006.jpg "title=" Picture 6.jpg "style=" Float:none; "alt=" wkiom1nfklwdbn44aabdqv43ra8006.jpg "/>

8. add the path to MySQL's command, which is easy to use

vim/etc/profile.d/mysql.sh

Path=/usr/local/mysql/bin: $PATH

. /etc/profile.d/mysql.sh Effective

9. Running security Scripts

Mysql_secure_installation

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M00/08/4D/wKiom1nfKr3CywOXAAEZL1LRWi8301.jpg "style=" float : none; "title=" Image 7.jpg "alt=" Wkiom1nfkr3cywoxaaezl1lrwi8301.jpg "/>

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M00/A7/04/wKioL1nfKAbDjTaNAACc8LQK2WY591.jpg "style=" float : none; "title=" Image 8.jpg "alt=" Wkiol1nfkabdjtanaacc8lqk2wy591.jpg "/>

10. mysql-uroot-p or mysql-uroot-p123456 connection database login

However, using the post command is dangerous because you can see that the password is 123456 in the history record.

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/08/4D/wKiom1nfKr2y0MWAAABjeRvyHl8091.jpg "title=" Picture 9.jpg "style=" Float:none; "alt=" wkiom1nfkr2y0mwaaabjervyhl8091.jpg "/>

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/A7/04/wKioL1nfKAfh55zPAABcUJJBUCU302.jpg "title=" Picture 10.jpg "style=" Float:none; "alt=" wkiol1nfkafh55zpaabcujjbucu302.jpg "/>

CentOS 6.9 binary installation mariadb 5.5.57

In the same way, only the log files are created differently, so the same is no longer carefully explained, only the commands are listed

1. Rpm-qa mysql* Make sure there's no database installed, there's a Lib library.

2. getent passwd MySQL to see if there are any mysql users

useradd-d/app/mysqldb-r-m-s/sbin/nologin mysql create MySQL user

3. RZ mariadb-5.5.57-linux-x86_64.tar.gz Import Package

Tar xvf mariadb-5.5.57-linux-x86_64.tar.gz-c/usr/local/unpacking and specifying the path

cd/usr/local/

Ln-s mariadb-5.5.57-linux-x86_64/mysql Creating a soft link

4. Create and edit a configuration file

mkdir/etc/mysql/

Cp/usr/local/mysql/support-files/my-huge.cnf/etc/mysql/my.cnf

Must be named MY.CNF.

VIM/ETC/MYSQL/MY.CNF Modify the configuration file to tell the database which path I specified

[Mysqld]

DataDir =/app/mysqldb

Innodb_file_per_table = On

Skip_name_resolve = On

5. Run the mysql_install_db script

cd/usr/local/mysql/

scripts/mysql_install_db--user=mysql--datadir=/app/mysqldb

6. Place the service script in the specified path and rename it to mysqld for easy invocation with Systemctl

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

Chkconfig--add mysqld

Chkconfig--list mysqld

7. Create a log file

Touch/var/log/mysqld.log

Chown Mysql/var/log/mysqld.log

Service mysqld Start

When you start, you see that port 3306 is turned on.

If you do not know what files to create, you can start the service, read the wrong tips to know.

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/A7/04/wKioL1nfK8nQ5UWYAABK-vzN794298.jpg "title=" Picture 11.jpg "alt=" Wkiol1nfk8nq5uwyaabk-vzn794298.jpg "/>

8. add the path to MySQL's command, which is easy to use

vim/etc/profile.d/mysql.sh

Path=/usr/local/mysql/bin: $PATH

. /etc/profile.d/mysql.sh

9. Running security Scripts

Mysql_secure_installation

10. mysql-uroot-p or mysql-uroot-p123456 connection database login


The above is the binary installation mariadb steps, if in doubt, welcome message

650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0080.gif "alt=" J_0080.gif "/>


Binary installation mariadb

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.