CentOS6.5下安装mysql-5.7.18-linux-glibc2.5-x86_64

来源:互联网 发布:bender建模软件 编辑:程序博客网 时间:2024/06/07 01:21

在安装mysql之前,先执行如下命令

rpm -qa | grep mysql #查找mysql相关软件yum -y remove mysql-libs-5.1.71-1.el6.x86_64 #卸载mysql-libs-5.1.71-1.el6.x86_64

首先先下载mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz,传到CentOS6.5系统下的/usr/local目录下,执行如下命令

yum search libaio  # search for infoyum install libaio # install librarygroupadd mysqluseradd mysql -g mysqlcd /usr/localtar -zxvf /usr/local/mysql-5.7.18-linux-glibc2.5-x86_64.tar.gzmv mysql-5.7.18-linux-glibc2.5-x86_64/ mysqlcd mysql/mkdir datacd ../chown -R mysql:mysql mysql/chmod -R 755 mysql/cd mysql./bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize 

查找密码,一般在命令的末尾,

 2017-04-21T02:36:15.620346Z 1 [Note] A temporary password is generated for root@localhost: o*s#gqh)F4Ck  
./support-files/mysql.server startln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqlservice mysql restart #重启服务mysqlln -s /usr/local/mysql/bin/mysql /usr/bin #做个软链接,将安装目录下的mysql 放在/usr/bin 目录下mysql -uroot -po*s#gqh)F4Ckalter user 'root'@'localhost' identified by '123456'; #设置root的密码为123456use mysql;update user set user.Host='%' where user.User='root';flush privileges;
[root@localhost ~]# chkconfig mysql on #设置mysql服务开机重启

最后,可以添加配置文件

vi /usr/local/mysql/my.cnf #编辑my.cnf

配置内容如下

# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the# *** default location during install, and will be replaced if you# *** upgrade to a newer version of MySQL.[mysqld]# Remove leading # and set to the amount of RAM for the most important data# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.# innodb_buffer_pool_size = 128M# Remove leading # to turn on a very important data integrity option: logging# changes to the binary log between backups.# log_bin# These are commonly set, remove the # and set as required.# basedir = .....# datadir = .....port = 3306# server_id = .....# socket = .....# Remove leading # to set options mainly useful for reporting servers.# The server defaults are faster for transactions and fast SELECTs.# Adjust sizes as needed, experiment to find the optimal values.# join_buffer_size = 128M# sort_buffer_size = 2M# read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 驾考中心考场停考预约的考试怎么办 口令卡绑定第一次身份证输错怎么办 第一次去医院看病没带身份证怎么办 考科目二紧张怎么办如何消除紧张 考科目三紧张怎么办如何消除紧张 我的驾考准考证和发票丢了怎么办 科目二预约考试下一步点不了怎么办 护士资格证未注册过期没注册怎么办 上海护士延续体检有乙肝携带怎么办 护士资格证从诊所变更到医院怎么办 杭州驾考预约面授没有去怎么办 在外地考的驾驶证丢了怎么办 身份证和驾驶证在外地丢了怎么办 我有摩e照学c1照怎么办 科三网上预约超过了次数限制怎么办 驾照罚款没交过了周期怎么办 驾照考了科科目一想换个驾校怎么办 韩国货物被机场海关扣了怎么办 车管所查不到居住证信息怎么办 高中毕业两年了想考大学怎么办 我买的二手货车营运证是假的怎么办 移民到欧洲国家想去日本怎么办签证 签证要写工作单位如果没有怎么办 办护照时的身份证过期了怎么办 有摩托车驾照想考小车驾照怎么办 分管副局长能直接安排工作吗怎么办 我在北京打工老婆没地方住怎么办 我的车扣了32分怎么办 济南万科地产投诉电话不管用怎么办 买手机被商家欺骗买到合约机怎么办 向消协投诉有用吗?我该怎么办? 我住南开区想办公租房不知怎么办 租房提前退房房东不退押金怎么办 体检时候眼睛有一只是弱视怎么办? b本被扣分9分了怎么办 工作调动后在新单位退休医保怎么办 社保卡和医保卡丢了怎么办 医保卡挂失后又找到了怎么办 医保卡丢失忘了卡号怎么办? 医保卡丢了怎么办又记不住卡号 住院发票丢了医保不给报销怎么办