mysql5.7.9 install

 

useradd -r -M -s /sbin/nologin mysql

chown -R mysql  /usr/local/mysql

chgrp -R mysql /usr/local/mysql

#初始化 并生成随机的root密码 

mysqld --initialize

 

cp -a /support-files/my-default.cnf  /etc/my.cnf

cp -a /support-files/mysql.server  /etc/init.d/mysqld 

 

service mysqld start

 

#修改root密码

set password for 'root'@'localhost' = password('xxxxx');

 

#查看my.cnf 地址

mysqld --verbose --help | grep -A 1 'Default options'

 

#修复报错/tmp/mysql.sock找不到 这里也可以创建软链

[client]

socket = /var/lib/mysql/mysql.sock

 

[mysqld]

socket = /var/lib/mysql/mysql.sock

你可能感兴趣的:(安装,mysql5.7.9)