标签:socket 问题: down use options chown init mic mysql
mysql国内镜像地址:http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-8.0/
mysql官网地址:https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.19-linux-glibc2.12-x86_64.tar.xz
#在根目录新建www
cd /
mkdir www
cd www
tar -xvf mysql-8.0.19-linux-glibc2.12-x86_64.tar.xz
-- /usr/local 目录下创建文件夹存
mkdir /usr/local/mysql
--移动
mv mysql-8.0.19-linux-glibc2.12-x86_64 /usr/local/mysql
--添加mysql组和mysql用户
--添加mysql组
groupadd mysql
--添加mysql用户
useradd -r -g mysql mysql
--初始化mysql配置
cd /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/datachown -R mysql:mysql /usr/local/mysql ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
chown -R root:root /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql/data
--复制配置文件
cp /etc/my.cnf my.cnf
chmod 777 ./my.cnf
vi my.cnf
---
[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
port=3306
socket=/usr/local/mysql/tmp/mysql.sock
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
---
mkdir tmp
chmod 777 tmp
--将mysql服务添加到/etc/init.d
cp /support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
--添加服务
chkconfig -add -mysql
--查看是否添加成功
chkconfig --list mysql
#查看mysql配置文件优先级
./bin/mysql --help | grep ‘Default options‘ -A 1
标签:socket 问题: down use options chown init mic mysql
原文地址:https://www.cnblogs.com/mg007/p/12642706.html