标签:mysql5.7
Mysql5.7.18rpm -qa|grep mariadb // 查询出来已安装的mariadb
rpm -e --nodeps 文件名 // 卸载mariadb,文件名为上述命令查询出来的文件
yum -y install gcc gcc-c++ ncurses ncurses-devel cmake bison
5.7/5.7解压改名
chmod -R 755 mysql/
chown -R lbd.lbd mysql/
lbd用户默认已经创建 有人喜欢用mysql用户
rm /etc/my.cnf
mkdir –p /usr/local/mysql/data
mkdir –p /var/lib/mysql/
bin/mysqld –initialize --user=lbd basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
haoglu1Gw6;c各自不同的密码
bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data
vim /etc/my.cnf
[mysql]
default-character-set=utf8
[mysqld]
skip-name-resolve
#设置3306端口
port = 3306
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
max_allowed_packet=16M
cp support-files/mysql.server /etc/init.d/mysqld
vim /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/usr/local/mysql/bin
屏蔽
#lockdir=‘/var/lock/subsys‘
#lock_file_path="$lockdir/mysql"
cd /usr/local
chown -R lbd.lbd mysql/
service mysqld start
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
chkconfig --add mysqld #增加mysqld服务
chkconfig --list #列出所有的系统服务
chkconfig --level 35 mysqld on
#设定mysqld在等级3和5为开机运行服务
mysql –u root –p
之前的密码
SET PASSWORD = PASSWORD(‘lbd123‘);重置密码
grant all privileges on . to ‘root‘@‘%‘ identified by ‘lbd123‘;
FLUSH PRIVILEGES;
mysql5.7和mysql5.6同在CentOS7.4安装差异对比之5.7.18
标签:mysql5.7
原文地址:http://blog.51cto.com/12102819/2108242