我的快速安装MySQL手册

put D:\soft\mysql\mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz ./

tar -zxvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz

groupadd mysql
useradd -r -g mysql -s /sbin/nologin mysql

mkdir -p /app/{mysql,data,log}/

mv mysql-5.7.18-linux-glibc2.5-x86_64/* /app/mysql/

put D:\soft\mysql\my.cnf  /etc/

chown -R mysql.mysql /app/{mysql,data,log}
cd /app/mysql/bin
./mysqld --initialize-insecure --user=mysql --basedir=/app/mysql/ --datadir=/app/data/ 

cp /app/mysql/support-files/mysql.server /etc/init.d/mysql

cd /app/mysql/bin
./mysqld_safe --user=mysql &

service mysql start 

./mysql

set password=password('mysql');

flush privileges;

grant all privileges on *.* to root@'%' identified by 'mysql';
grant all privileges on *.* to 'hemq'@'%' identified by 'hemq';


cat >> /etc/profile << EOF
PATH=/app/mysql/bin:/app/mysql/lib:$PATH
export PATH
EOF

source /etc/profile



猜你喜欢

转载自blog.csdn.net/fxnawm/article/details/78674510