当前位置: 首页 > news >正文

CentOS7 MySql 5.6.39安装

1.检查系统是否安装了mariadb

rpm -qa | grep mariadb

发现已经安装,卸载

rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64

2.创建mysql用户组

groupadd mysql
useradd -g mysql mysql
tar -zxvf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz

 
mv 解压出来的文件夹名 /usr/local/mysql
cp my-default.cnf /etc/my.cnf
 
 

3.my.cnf编辑

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/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.
[mysql]
default-character-set=utf8
socket=/var/lib/mysql/mysql.sock

[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=/usr/local/mysql
datadir=/usr/local/mysql/data
port=3306
server_id=1
socket=/var/lib/mysql/mysql.sock
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
lower_case_table_name=1
max_allowed_packet=16M

# 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 

4.创建文件夹执行权限

mkdir /var/lib/mysql

yum -y install perl perl-devel

yum install -y perl-Data-Dumper

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

chown -R mysql:mysql data

chown 777 /etc/my.cnf

cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld

chmod +x /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --list mysqld

mysql -uroot -p
没有密码直接回车
use mysql;
update user set password=password('root') where user='root' and host='localhost';
flush privileges;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
flush privileges;

 

相关文章:

  • MySql注册表删除
  • Oracle 11 64位安装
  • MySQL 卸载
  • Linux java 内存与堆栈信息查看
  • CentOS-7 MySQL 5.7.20安装
  • Linux Java配置命令
  • MySQL数据库服务器迁移
  • IntelliJ IDEA 破解
  • 删除工程中的.svn文件
  • MySql 编码方式修改
  • maven简单的使用
  • 父类与子类的执行顺序
  • Eclipse 打开时总是弹出welcome
  • Ubuntu 7z安装
  • build.xml
  • 【Redis学习笔记】2018-06-28 redis命令源码学习1
  • ES10 特性的完整指南
  • IE报vuex requires a Promise polyfill in this browser问题解决
  • Java基本数据类型之Number
  • leetcode46 Permutation 排列组合
  • pdf文件如何在线转换为jpg图片
  • vue-cli3搭建项目
  • weex踩坑之旅第一弹 ~ 搭建具有入口文件的weex脚手架
  • 官方新出的 Kotlin 扩展库 KTX,到底帮你干了什么?
  • 回流、重绘及其优化
  • 基于Javascript, Springboot的管理系统报表查询页面代码设计
  • 紧急通知:《观止-微软》请在经管柜购买!
  • 普通函数和构造函数的区别
  • 让你成为前端,后端或全栈开发程序员的进阶指南,一门学到老的技术
  • 详解NodeJs流之一
  • d²y/dx²; 偏导数问题 请问f1 f2是什么意思
  • AI又要和人类“对打”,Deepmind宣布《星战Ⅱ》即将开始 ...
  • MPAndroidChart 教程:Y轴 YAxis
  • # 透过事物看本质的能力怎么培养?
  • #include到底该写在哪
  • (13)Latex:基于ΤΕΧ的自动排版系统——写论文必备
  • (Matlab)使用竞争神经网络实现数据聚类
  • (WSI分类)WSI分类文献小综述 2024
  • (博弈 sg入门)kiki's game -- hdu -- 2147
  • (第27天)Oracle 数据泵转换分区表
  • (第二周)效能测试
  • (转)GCC在C语言中内嵌汇编 asm __volatile__
  • .NET MAUI学习笔记——2.构建第一个程序_初级篇
  • .NET/MSBuild 中的发布路径在哪里呢?如何在扩展编译的时候修改发布路径中的文件呢?
  • .net6Api后台+uniapp导出Excel
  • [1159]adb判断手机屏幕状态并点亮屏幕
  • [BJDCTF2020]The mystery of ip1
  • [BZOJ5125]小Q的书架(决策单调性+分治DP+树状数组)
  • [CF703D]Mishka and Interesting sum/[BZOJ5476]位运算
  • [Codeforces] probabilities (R1600) Part.1
  • [C语言]——柔性数组
  • [error] 17755#0: *58522 readv() failed (104: Connection reset by peer) while reading upstream
  • [iOS]把16进制(#871f78)颜色转换UIColor
  • [Linux] Boot分区满了的处理方法 The volume boot has only 0 bytes disk space remaining
  • [Linux]history 显示命令执行的时间