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

Centos 6.5 install mysql in one minute

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

Share

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

centos 6.5 minutes to install mysql

performed manually

wget https://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm

rpm -Uvh mysql57-community-release-el6-9.noarch.rpm

yum install mysql-community-server

service mysqld start

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

grep 'temporary password' /var/log/mysqld.log

mysql -uroot -p #Enter the filtered password

set global validate_password_policy=0; #Modify password complexity

set global validate_password_length=6; #Change password length

ALTER USER 'root'@'localhost' IDENTIFIED BY 'abc123'; modify password

One-click installation script

vim auto_install_mysql.sh

#!/ bin/bash

yum install -y wget

wget https://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm

rpm -Uvh mysql57-community-release-el6-9.noarch.rpm

yum clean all

sleep 2

yum install mysql-community-server -y

/etc/init.d/mysqld start

chkconfig --level 2345 mysqld on

for i in `grep 'temporary password' /var/log/mysqld.log| awk -F": " '{print $2}'`;

do

mysql -uroot -p$i -e "set global validate_password_policy=0;" -b --connect-expired-password

mysql -uroot -p$i -e "set global validate_password_length=6;" -b --connect-expired-password

mysql -uroot -p$i -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'abc123';" -b --connect-expired-password

/usr/bin/mysqladmin -u root -p$i password 'abc123' -b --connect-expired-password

mysql -uroot -p"abc123" -e "show databases;"

echo "mysql is install ok"

done

service mysqld restart

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

service iptables save

/etc/init.d/iptables restart

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