1、安装yum源,已经下载安装包
------------------------------------------------
rpm -ivh epel-release-latest-7.noarch.rpm
------------------------------------------------
2、安装vim
yum -y install vim
------------------------------------------------
yum -y install wget
------------------------------------------------
yum -y install ruby
------------------------------------------------
3、Linux下添加磁盘、挂载,见挂载详情
------------------------------------------------
注意:关闭防火墙 systemctl stop firewalld.service
------------------------------------------------
4、mysql安装
5、官网下载安装mysql-server
5.1 官网下载rpm包 https://dev.mysql.com/downloads/repo/yum/
安装wget
yum -y install wget
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server
6、安装成功后重启mysql服务
service mysqld restart
mysql_secure_installation(设置密码)
初次安装mysql,root账户没有密码
查看密码 cat /var/log/mysqld.log | grep password
grep ‘temporary password‘ /var/log/mysqld.log
首次登录,修改密码:修改密码 set password for ‘root‘@‘localhost‘ =password(‘your password‘);
查看安装路径 whereis mysql
mysql 登录mysql:mysql -u root -p
密码:ShiQq!123456
mariadb 密码:Seari@123456
查看密码 cat /var/log/mysqld.log | grep password
修改密码 set password for ‘root‘@‘localhost‘ =password(‘password‘);
查看安装路径 whereis mysql
重启mysql:service mysqld restart
自启动mysql:systemctl enable mysqld
7、配置mysql,这里的字符编码必须和/usr/share/mysql/charsets/Index.xml中一致
详见:http://www.cnblogs.com/starof/p/4680083.html
8、远程连接设置
把在所有数据库的所有表的所有权限赋值给位于所有IP地址的root用户。
mysql> grant all privileges on *.* to root@‘%‘identified by ‘password‘;
如果是新用户而不是root,则要先新建用户
mysql>create user ‘username‘@‘%‘ identified by ‘password‘;
此时就可以进行远程连接了。
用navicat,登录