- https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz
tar zxf mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.35-linux-glibc2.12-x86_64 mysql
mkdir /data/mysql/data -p
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /data/mysql/data
chmod +rwx /tmp/mysql.sock
cat>/etc/my.cnf<[mysqld]
datadir=/data/mysql/data
port=3306
skip-grant-tables
[client]
socket=/tmp/mysql.sock
EOF
cat>/etc/profile<export PATH=$PATH:/usr/local/mysql/bin
EOF
source /etc/profile
cd /usr/local/mysql
bin/mysqld –initialize –user=mysql –datadir /data/mysql/data
cp support-files/mysql.server /etc/init.d/
yum install libncurses* -y
/etc/init.d/mysql.server start
echo “Mysql安装成功!!!”
mysql
update mysql.user set authentication_string=password(‘hadoop123’) where user=’root’ and Host =’localhost’;
flush privileges;
exit
mysql -u root -phadoop123">/bin/bash
#mysql部署
useradd mysql
cd /usr/local/
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz
tar zxf mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.35-linux-glibc2.12-x86_64 mysql
mkdir /data/mysql/data -p
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /data/mysql/data
chmod +rwx /tmp/mysql.sock
cat>/etc/my.cnf<[mysqld]
datadir=/data/mysql/data
port=3306
skip-grant-tables
[client]
socket=/tmp/mysql.sock
EOF
cat>/etc/profile<export PATH=$PATH:/usr/local/mysql/bin
EOF
source /etc/profile
cd /usr/local/mysql
bin/mysqld –initialize –user=mysql –datadir /data/mysql/data
cp support-files/mysql.server /etc/init.d/
yum install libncurses* -y
/etc/init.d/mysql.server start
echo “Mysql安装成功!!!”
mysql
update mysql.user set authentication_string=password(‘hadoop123’) where user=’root’ and Host =’localhost’;
flush privileges;
exit
mysql -u root -phadoop123
/bin/bash
#mysql部署
useradd mysql
cd /usr/local/
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz
tar zxf mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.35-linux-glibc2.12-x86_64 mysql
mkdir /data/mysql/data -p
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /data/mysql/data
chmod +rwx /tmp/mysql.sock
cat>/etc/my.cnf<[mysqld]
datadir=/data/mysql/data
port=3306
skip-grant-tables
[client]
socket=/tmp/mysql.sock
EOF
cat>/etc/profile<export PATH=$PATH:/usr/local/mysql/bin
EOF
source /etc/profile
cd /usr/local/mysql
bin/mysqld –initialize –user=mysql –datadir /data/mysql/data
cp support-files/mysql.server /etc/init.d/
yum install libncurses* -y
/etc/init.d/mysql.server start
echo “Mysql安装成功!!!”
mysql
update mysql.user set authentication_string=password(‘hadoop123’) where user=’root’ and Host =’localhost’;
flush privileges;
exit
mysql -u root -phadoop123
datadir=/data/mysql/data
port=3306
skip-grant-tables
[client]
socket=/tmp/mysql.sock
EOF
cat>/etc/profile<
EOF
source /etc/profile
cd /usr/local/mysql
bin/mysqld –initialize –user=mysql –datadir /data/mysql/data
cp support-files/mysql.server /etc/init.d/
yum install libncurses* -y
/etc/init.d/mysql.server start
echo “Mysql安装成功!!!”
mysql
update mysql.user set authentication_string=password(‘hadoop123’) where user=’root’ and Host =’localhost’;
flush privileges;
exit
mysql -u root -phadoop123