CentOS6.8 Mysql

Categories:

CentOS安装MySql服务


1.下载
官网下载地址:https://dev.mysql.com/downloads/mysql/

本地下载:mysql-5.6.38-linux-glibc2.12-x86_64.tar.gz part1 part27zip

2.安装

使用ftp上传压缩包

images

解压

tar -zxvf mysql-5.6.38-linux-glibc2.12-x86_64.tar.gz

修改文件夹名为mysql

进入mysql文件夹

安装

scripts/mysql_install_db --user=mysql --basedir=/usr/local/software/mysql --datadir=/usr/local/software/mysql/data

编辑 my.cnf 配置文件 添加如下内容

images

编辑 /etc/my.cnf 文件 添加如下内容

images

编辑 /etc/my.cnf 文件,添加如下内容,设置大小写不敏感

images

启动mysql服务

service mysql start

 

查看服务启动状态

ps -ef|grep mysql

进入mysql

修改root密码

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

退出 —— quit

登录mysql

mysql -u 用户名 -p

 

输入密码,屏幕无反馈

让root可以远程登录

grant all privileges on *.* to 'root' @'%' identified by 'root';