1. Install MySQL wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz #下载mysql tar ZXVF mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz #解压mysql文件 CP mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz/usr/local /mysql-r #复制解压后的mysql目录到系统的本地软件目录 groupadd mysql #创建mysql组 useradd mysql-g mysql #创建mysql用户并添加到mysql用户组 pwd #当前目录/us R/local/mysql chown-r MySQL. #修改mysql所属用户 chgrp-r MySQL. #修改mysql所属组 cd/usr/local/mysql/bin Yum Install Libaio/mysqld--user=mysql--basedir=/usr/local/mysql/--datadir=/usr /local/mysql/data #data目录没有就创建, in addition mysql_install_db This command has been abolished replaced by mysqld ln-s/usr/local/mysql/bin/mysql/usr/bin/mysql # Create MySQL shortcut service MySQL start #启动mysql服务 service MySQL stop #停止mysql服务 service mysql restart #重启mysql服务 netstat-anp |grep mysqld #查看mysql服务 2, the next is landed because it is the first time to land, the way I use this is Cat/root/.mysql_secret #这个是root首次登陆mysql的初始密码 mysql-uroot -p password 3, set remote client login mysql>grant all privileges on *.* to ' root ' @' 192.168.0.0 ' IDENTIFIED BY ' 123456 ' WITH GRANT OPTION; mysql>flush privileges;
CentOS7 installing MySQL