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

A brief Analysis of mysql compiling and installing by blackmed

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

The following content mainly brings you mysql compilation installation by blackmed analysis, the knowledge mentioned here, slightly different from books, are professional and technical personnel in contact with users, summed up, has a certain experience sharing value, hope to bring help to the majority of readers.

#!/ usr/bin/env bash

#mysql compiled by blackmed

byhe(){

rpm -qa | grep mariadbif [ $? -eq 0 ];then rpm -e --nodeps >/dev/nullfirm -rf /etc/my* >/dev/nullrm -rf /var/lib/mysql >/dev/nulluserdel -r mysql >/dev/nullrpm -qa | grep cmakeif [ $? -ne 0 ];then yum -y install cmake ncurses ncurses-devel openssl-devel bison gcc gcc-c++ make >/dev/nullecho "========================================"echo "The success of the prophase environment. "echo "========================================"fiuseradd -r mysql -M -s /sbin/nologin

mkdir /mysqlwget -O /mysql/mysql-5.7.20.tar.gz https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.20.tar.gz >/dev/nulltar xvf /mysql/mysql-5.7.20.tar.gz -C /mysql/cd /mysql/mysql-5.7.20cmake . -DDOWNLOAD_BOOST=1 -DWITH_BOOST=boost_1_59_0/ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DMYSQL_DATADIR=/usr/local/mysql/data -DINSTALL_MANDIR=/usr/share/man -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DEXTRA_CHARSETS=all -DDEFAULT_COLLATION=utf8_general_ci -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 make && make install echo "===========================" echo "mysql install successfully" echo "==========================="chown -R mysql.mysql /usr/local/mysql/local_mysql=/usr/local/mysql/bin${local_mysql}/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data mima=`${local_mysql}/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data | awk '/localhost\:/{print $NF}' `touch /etc/my.cnfecho "[mysqld]" >> /etc/my.cnfecho "basedir=/usr/local/mysql" >> /etc/my.cnfecho "datadir=/usr/local/mysql/data" >> /etc/my.cnfsed -i '/PATH=/cPATH=$PATH:$HOME/bin:/usr/local/mysql/bin' ~/.bash_profilesource ~/.bash_profilemysqld_safe --user=mysql & mysqladmin -u root -p${mima} password 1echo "==============================================="echo "Initialization completion can be used normally. "echo "==============================================="}

byhe

For the above analysis of mysql compilation and installation by blackmed, if you still need to know more, you can continue to pay attention to our industry promotion, if you need to get professional answers, you can contact the pre-sales and after-sales on the official website, I hope this article can bring you some knowledge updates.

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