Centos5.8 安装 MySQL5.6.19
查看已经安装的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.-linux-glibc2.-x86_64.tar.gz
# ln -s mysql-advanced-5.6.-linux-glibc2.-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 &
[]
[root@racnote1 mysql]# :: mysqld_safe Logging to '/usr/local/mysql/data/racnote1.err'.
:: 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.server
find "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
Centos5.8 安装 MySQL5.6.19的更多相关文章
- CentOS7.2安装mysql-5.7.19多实例
安装多实例之前首先需要先安装mysql,这里就不介绍如何安装mysql了,参考前面的博客:https://www.cnblogs.com/hei-ma/p/9505509.html 安装多实例之前需要 ...
- CentOS6.9 下编译安装MySQL5.7.19
官网:https://www.mysql.com/ 下载地址:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19.tar.gz 一.准备工作 ...
- centos7安装mysql5.7.19及配置远程连接
centos7安装mysql5.7.19及配置远程连接------https://blog.csdn.net/Lh19931122/article/details/77996213
- 【环境部署】centos7安装mysql-5.7.19 group-replication
--mysql高可用官方文档: https://dev.mysql.com/doc/refman/5.7/en/group-replication.html mysql下载地址: https://ww ...
- 安装MySQL5.7.19 网上的文章参考 并做了部分修改
1,从官方网址下载MySQL5.7.19源码包 http://dev.MySQL.com/downloads/mysql/#downloads 2,安装好CentOS6.7 64位操作系统. ...
- linux-Centos7安装mysql5.7.19
1.下载mysql 网址: https://dev.mysql.com/downloads/mysql/ 2.选择源码包,通用版点击下载 直接下载就可以了,不用登录 3.解压编译 先安装相关依赖包 y ...
- Windows下安装MySQL-5.7.19
下载MySQL-5.7.19版本,解压之后发现安装包不是一个exe文件: 于是网上找资料,发现了另外一种安装方法. 1.新建一个环境变量,我的电脑-属性-高级-环境变量-系统变量-新建 2.在系统变量 ...
- win7配置免安装mysql5.6.19过程具体解释
本文主要介绍免安装配置mysql5.6.19的过程,整个过程中自己出现非常多次失误,经过整理,现将一次可成功的过程记录下来,供大家參考. 准备 在mysq官网 http://dev.mysql.com ...
- Centos6.5安装mysql5.7.19
一.安装前准备 安装采用二进制包方式,软件包5.7.19版本下载地址:https://dev.mysql.com/downloads/mysql/ 选择MYSQL Community Server版本 ...
随机推荐
- 运算符&,|,^
1.&按位“与”的计算是把两个数字分别写成二进制形式,然后按照每一位进行比较,&计算中,只要有一个是0就算成02.|运算转换成2进制进行比较,两个位只要有一个为1,那么结果就是1,否则 ...
- 搭建一个完整的Android工程(一)Dagger2
写在前面 现在越来越多的使用到了开源项目,但是仅限于使用,却不了解,更谈不上深入.也是因为越来越多的开源项目,平时工作中遇到问题也是第一时间寻找对应的开源项目,少了许多独立的思考.现在虽然能很轻松的完 ...
- XML解析之DOM详解及与SAX解析方法的比较
XML解析(DOM) XML文件解析方法介绍 我们所用到的NSXMLParser是采用SAX方法解析 SAX(Simple API for XML) 只能读,不能修改,只能顺序访问,适合解析大型XML ...
- 最近项目用到Dubbo框架,临时抱佛脚分享一下共探讨。
1. Dubbo是什么? Dubbo是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案.简单的说,dubbo就是个服务框架,如果没有分布式的需求,其实是不需 ...
- 从技术经理的角度算一算,如何可以多快好省的做个app
[导读]前端时间,一篇“从产品经理的角度算一算,做个app需要多少钱”的文章在网上疯传,可见大家对互联网创业的热情!这次,从一名技术经理的角度再给大家分析一下,如何使用跨平台开发技术为你节省上百万的开 ...
- Java基础知识学习(六)
多线程 先了解线程的概念 多线程需要注意的地方 优先级.线程同步.消息传递.数据共享.死锁等 Java线程类 Thread,实现接口 Runnable Thread常用方法 getName 获得线程名 ...
- Java Gradle入门指南之插件管理(类型、导入及java plugin使用)
上一篇随笔介绍了如何使用Gradle内建任务,介绍了自定义Gradle任务类的三种方法(build文件,buildSrc文件夹.新建groovy项目),一个任务是一个原子操作,即不可分割的.项 ...
- Java Gradle入门指南之gretty插件(安装、命令与核心特性)
Java Web应用开发时常使用Gradle来进行项目管理,可以十分便利地解决包依赖等问题.war插件的出现,让项目部署成为一个复制粘贴的过程,那有没有办法让Java web应用的部署,就像w ...
- JavaScript Patterns 5.4 Module Pattern
MYAPP.namespace('MYAPP.utilities.array'); MYAPP.utilities.array = (function () { // dependencies var ...
- CentOS 6.5 生产环境编译安装LNMP
一.环境准备 1.操作系统安装:CentOS 6.5 64位最小化安装. 2.配置好IP.DNS.网关.主机名 3.配置防火墙,开启80.3306端口 vim /etc/sysconfig/iptab ...