查看已经安装的mysql:

sudo yum list installed |grep mysql

删除

sudo yum remove mysql

安装

sudo rpm -ivh MySQL-server-5.6.19-1.rhel5.x86_64.rpm

会发现mysql已经被添加到/etc/init.d/

查看服务状态

sudo /sbin/service mysql status

启动服务

sudo /sbin/service mysql start

ps查看, 服务运行在mysql用户下,

检查启动参数

sudo /sbin/chkconfig –list mysql

mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off

已经添加到系统自启动

my.cnf在 /usr 下, 添加以下基本参数

join_buffer_size = 64M

sort_buffer_size = 4M

read_rnd_buffer_size = 4M

key_buffer_size=16M

max_allowed_packet=16M

修改默认端口会遇到selinux的权限问题, 具体可以看

https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql

可以通过 sudo /usr/sbin/semanage port -l 查看当前的端口状态

semanage port -a -t mysqld_port_t -p tcp 6033

就可以指定其他端口了

#########

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !

You will find that password in ‘/home/milton/.mysql_secret’.

You must change that password on your first connect,

no other statement but ‘SET PASSWORD’ will be accepted.

See the manual for the semantics of the ‘password expired’ flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.

This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

#########

编译安装

需要预先安装ncurses-devel, 否则会报错”Curses library not found”.

sudo yum install ncurses-devel

cmake需要用root权限运行:

sudo cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql

-DMYSQL_DATADIR=/opt/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1

-DMYSQL_TCP_PORT=6033 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8

-DDEFAULT_COLLATION=utf8_general_ci

添加用户和组

shell> sudo groupadd mysql

shell> sudo useradd -r -g mysql mysql

# cd /opt/mysql

# sudo chown -R mysql .

# sudo chgrp -R mysql .

安装测试数据

# sudo scripts/mysql_install_db –user=mysql

显示如下:

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password ‘new-password’

./bin/mysqladmin -u root -h ML-M0 password ‘new-password’

Alternatively you can run:

./bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default. This is

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

New default config file was created as ./my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

再修改用户

# sudo chown -R root .

# sudo chown -R mysql data

启动服务

# sudo bin/mysqld_safe –user=mysql &

添加到系统启动

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

# sudo chkconfig --add mysqld

Centos 6.3 压缩包安装MySQL5.6.2x

# cd /opt/mysql

#tar zxvf mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz

#ln -s mysql-advanced-5.6.23-linux-glibc2.5-x86_64 mysql

# cd mysql

#--- install &init

#sudo chown -R mysql:mysql .

#sudo ./scripts/mysql_install_db --user=mysql

#---start the server (这边加 --user=mysql 的时候不成功, 后来不加这个才正常启动的)

#sudo ./bin/mysqld_safe &[1] 3492[root@racnote1 mysql]#150324 16:33:40 mysqld_safe Logging to '/usr/local/mysql/data/racnote1.err'.150324 16:33:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

Ctrl+C

#---add it to the service

#sudo cp support-files/mysql.server /etc/init.d/mysql.server

#sudo vi /etc/init.d/mysql.serverfind "basedir=", add the path to mysql installation, e.g. "basedir=/opt/mysql/mysql"#sudo chkconfig --list

#sudo chkconfig --add mysql.server

#sudo chkconfig --list

#---initialize the root password

#sudo ./bin/mysql_secure_installation

#--- link the mysql executable to /usr/bin

# cd/usr/local/bin

#sudo ln -s /opt/mysql/mysql/bin/mysql mysql

centos mysql 5.6.19_Centos5.8 安装 MySQL5.6.19相关推荐

  1. centos mysql rpm re_CentOS 7 RPM 安装 MySQL5.7

    0.环境 本文操作系统: CentOS 7.2.1511 x86_64 MySQL 版本: 5.7.13 1.卸载系统自带的 mariadb-lib [root@centos-linux ~]# rp ...

  2. CentOS6.9 下编译安装MySQL5.7.19

    官网:https://www.mysql.com/ 下载地址:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19.tar.gz 一.准备工作 ...

  3. yum安装mysql后密码_Centos7:yum安装MySQL5.7后如何设置root密码

    Centos下安装软件的方式很简单,只需要通过yum install xxx命令即可.第一步当然检查是否有mysql的yum源,命令:yum list|grep mysql-community[主要还 ...

  4. linux安装多个mysql数据库_linux下多个mysql5.7.19(tar.gz)安装图文教程

    初级第一次在Linux下安装MySQL-5.7.19版本教程请看上一篇,如果已经会安装了,那么请看这篇linux下安装多个mysql-5.7.19 环境:centos 6.5 1-下载 2-跳过登陆 ...

  5. centos安装mysql5.7.19_Linux下Centos7安装Mysql5.7.19的详细教程

    1.下载mysql 2.选择源码包,通用版点击下载 直接下载就可以了,不用登录 3.解压编译 tar -zxvf mysql-5.7.19.tar.gz cd mysql-5.7.19.tar.gz ...

  6. centos mysql 5.2.3 编译安装_在CentOS上编译安装MySQL 5.7.13步骤详解

    MySQL 5.7主要特性 更好的性能 对于多核CPU.固态硬盘.锁有着更好的优化,每秒100W QPS已不再是MySQL的追求,下个版本能否上200W QPS才是用户更关心的. 更好的InnoDB存 ...

  7. 5.7.24mysql 配置安卓,安卓按键精灵连接MySQL全面解析Windows下安装 mysql5.7的方法

    关于在windows下安装mysql 5.7 •要注意的新坑: 5.7版本安装后ROOT账号是有默认的密码的,这个密码在windows下可以在mysql.ini配置文件指定的data文件夹下面,那个为 ...

  8. server2016安装mysql_windows server2016安装MySQL5.7.19解压缩版教程详解

    记录了MySQL 5.7.19 winx64解压缩版安装教程,具体内容如下 系统环境:Win7 x64 软件准备:mysql 5.7.19 winx64 配置安装流程 具体安装如下: 1.把 mysq ...

  9. linux-ubuntu 安装mysql5.7.19的一些坑

    2019独角兽企业重金招聘Python工程师标准>>> linux-ubuntu 安装mysql5.7.19的一些坑 在linux下安装MySQL有很多介绍,流程大同小异,但往往一些 ...

最新文章

  1. iphone 使用popViewController如何避免内存泄露
  2. 信息学奥赛一本通(1110:查找特定的值)
  3. 在线JSON转HTML,TABLE表格工具
  4. Python-在线文本情感分析实验
  5. 实验3-8 输出三角形面积和周长 (15 分)
  6. 雅虎再掀高管离职潮 博客列三大原因
  7. 所有 HTTP 状态代码及其定义
  8. WeakHashMap回收时机结合JVM 虚拟机GC的一些理解
  9. 论文笔记:SAIN: Self-Attentive Integration Network for Recommendation(SIGIR 2019)
  10. Bin文件夹下的DLL可以做什么?
  11. input输入密码的时候调用纯数字键盘和加密,js弹出键盘
  12. weui popup的使用
  13. Java验证中文汉字、英文字母、标点符号一个字符占多少字节
  14. 计算机/设备和驱动器下有一个空白盘符无法删除
  15. RabbitMQ详解及其特性
  16. 塞雷三分钟漫画中国史4
  17. python3-多线程
  18. echarts 关系图graph
  19. [Matlab] 论文画图技巧:预测曲线图
  20. 2019年智能科学与产业综述论文盘点

热门文章

  1. 使用事务操作SQLite数据批量插入,提高数据批量写入速度,源码讲解
  2. oracle sql语句怎么查询所有存储过程中是否包含某个注释?
  3. Ext 中 radiogroup 的布局问题,当点击fieldLabel时,界面整体会向左移
  4. 阿里云可以外链mysql_案例详细说明阿里云下设置MySQL远程连接步骤
  5. SpringBoot: SpringBoot里面创建导出Excel的接口(亲测)
  6. 如何配置nginx+uwsgi+django?(知乎上面的看着不错)
  7. Linux Shell脚本编程--cut命令
  8. Linux之awk:按照字符或列进行筛选与计算列值 条件动作
  9. mysql行转列sql函数_sql动态行转列的两种方法
  10. 指令引用的0x0000000内存 不能为written_浅谈虚拟机内存区