标签:mysql5.6
Mysql5.6.40mkdir –p /var/lib/mysql/ rpm -qa|grep mariadb // 查询出来已安装的mariadb
rpm -e --nodeps 文件名 // 卸载mariadb,文件名为上述命令查询出来的文件
yum -y install gcc gcc-c++ ncurses ncurses-devel cmake bison
5.6解压改名
chmod -R 755 mysql/
chown -R lbd.lbd mysql/
lbd用户默认已经创建
rm /etc/my.cnf
mkdir –p /var/lib/mysql/
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --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
cd /usr/local
vim /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/usr/local/mysql/bin
屏蔽
#lockdir=‘/var/lock/subsys‘
#lock_file_path="$lockdir/mysql"
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
5.6初始没密码
grant all privileges on . to ‘root‘@‘%‘ identified by ‘lbd123‘;
FLUSH PRIVILEGES;
mysql5.7和mysql5.6同在CentOS7.4安装差异对比之5.6.40
标签:mysql5.6
原文地址:http://blog.51cto.com/12102819/2108245