以 root 身份登录 Linux 系统,创建 mysql 组和用户 [root@Nagios-Server ~]# groupadd mysql

[root@Nagios-Server ~]# useradd mysql -g mysql -M -s /sbin/nologin [root@Nagios-Server ~]# tail -1   /etc/passwd mysql:x:501:501::/home/mysql:/sbin/nologin

目前使用 mysql 版本比例:

Mysql 5.1 –20%   Mysql 5.5 –60%   Mysql 5.6 –20%

#安装 mysql 错误信息:

checking for termcap functions library... configure: error: No curses/termcap library found

#解决方法 yum -y install ncurses-devel

#安装错误信息

make[2]: *** [my_new.o] Error 127

make[2]: Leaving directory `/usr/local/src/mysql-5.0.41/mysys' make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/usr/local/src/mysql-5.0.41' make: *** [all] Error 2

#创建软连接 ln

[root@Nagios-Servermysql-5.1.72]# ln -s /application/mysql5.1.72/ /application/mysql

[root@Nagios-Servermysql-5.1.72]# ll /application/mysql

lrwxrwxrwx 1 root root 25 12 月   7 21:04 /application/mysql -> /application/mysql5.1.72/

#注意:若 mysql 和 apache 不是安装在同一天服务上的话。Mysql 的安装就到此为止! 若是在同台服务器上,请继续执行以下操作:

[root@Nagios-Server tools]# ll mysql-5.1.72/support-files/my*.cnf

-rw-r--r-- 1 root root   4746 12 月 7 21:03 mysql-5.1.72/support-files/my-huge.cnf

-rw-r--r--        1         root         root         19779         12        月                           7        21:03 mysql-5.1.72/support-files/my-innodb-heavy-4G.cnf

-rw-r--r-- 1 root root   4720 12 月 7 21:03 mysql-5.1.72/support-files/my-large.cnf

-rw-r--r-- 1 root root   4731 12 月 7 21:03 mysql-5.1.72/support-files/my-medium.cnf

-rw-r--r-- 1 root root   2499 12 月 7 21:03 mysql-5.1.72/support-files/my-small.cnf

#my.cnf 是 MySQL 默认的配置文件名

[root@Nagios-Server tools]# cd mysql-5.1.72/support-files/ [root@Nagios-Server support-files]# cp my-small.cnf /etc/my.cnf cp:是否覆盖"/etc/my.cnf"?y

#创建数据库文件

[root@Nagios-Server support-files]# mkdir /application/mysql/data –p

[root@Nagios-Server support-files]# chown -R mysql.mysql /application/mysql/data/ [root@Nagios-Serversupport-files]#/application/mysql/bin/mysql_install_db

#出现两个 OK 证明完成

141207 21:16:07 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.

OK

Filling help tables...

141207 21:16:08 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.

OK

#生成了两个库

[root@Nagios-Server support-files]# ll /application/mysql/data/ 总用量 8

drwx------ 2 mysql root 4096 12 月   7 21:16 mysql    #系统相关

drwx------ 2 mysql root 4096 12 月   7 21:16 test       #测试

#mysql 启动

[root@Nagios-Server support-files]# /application/mysql/bin/mysqld_safe& [root@Nagios-Server support-files]# netstat -lntup|grepmysqld

#在/etc/profile 中加入启动的详细路径

[root@Nagios-Server support-files]# vi /etc/profile

PATH="/application/mysql/bin/:$PATH"

#生效

[root@Nagios-Server support-files]# . /etc/profile

或者

[root@Nagios-Server support-files]# source /etc/profile

#登录 MySQL,查看到数据库表

[root@Nagios-Server support-files]# mysql mysql> show databases;

+--------------------+

| Database                   |

+--------------------+

| information_schema |

| mysql                        |

| test                         |

+--------------------+

3 rows in set (0.00 sec)

linux 建立 MySQL 账号的更多相关文章

  1. linux下Mysql 的安装、配置、数据导入导出

    MySQL是一种开放源代码的关系型数据库管理系统(RDBMS),虽然功能未必很强大,但因它的免费开源而广受欢迎. 这次,接着上一篇<CentOs minimal安装和开发环境部署>,讲下L ...

  2. Linux系统——MySQL基础(二)

    # MySQL数据库完全备份与恢复## 数据库备份的分类1. 从物理与逻辑的角度,备份可以分为物理备份和逻辑备份.(1)物理备份:对数据库操作系统的物理文件(数据文件.日志文件)的备份.物理备份又可分 ...

  3. [分享]运维分享一一阿里云linux系统mysql密码修改脚本

    [分享]运维分享一一阿里云linux系统mysql密码修改脚本       大象吃豆子 级别: 小白 发帖 12 云币 27 加关注 写私信   只看楼主 更多操作楼主  发表于: 2014-09-3 ...

  4. LNMP(linux+nginx+mysql+php)服务器环境配置

    一.简介 Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx,它的发音为 “engine X”, 是一个高性能的HTTP和反向代理服务器,同时也是一个IMAP/POP3/SMTP 代理服 ...

  5. (转)mysql账号权限密码设置方法

    原文:http://www.greensoftcode.net/techntxt/2013410134247568042483 mysql账号权限密码设置方法 我的mysql安装在c:\mysql 一 ...

  6. linux下MySQL安装登录及操作

    linux下MySQL安装登录及操作 二.安装Mysql 1.下载MySQL的安装文件 安装MySQL需要下面两个文件: MySQL-server-4.0.16-0.i386.rpm MySQL-cl ...

  7. Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)

    Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)   关于LAMP的各种知识,还请大家自行百度谷歌,在这里就不详细的介绍了,今天主要是介绍一下在Centos下安装,搭建一 ...

  8. [转] Ubuntu 12.04下LAMP安装配置 (Linux+Apache+Mysql+PHP)

    我是一个Linux新手,想要安装一台Ubuntu 12.04版的Linux服务器,用这台服务器上的LAMP套件来运行我自己的个人网站.LAMP套件就是 “Linux+Apache+Mysql+PHP这 ...

  9. linux下mysql的卸载、安装全过程

    卸载mysql 1.查找以前是否装有mysql 命令:rpm -qa|grep -i mysql 可以看到mysql的两个包: mysql-4.1.12-3.RHEL4.1 mysqlclient10 ...

随机推荐

  1. 跨平台迁移数据库windows-Linux

    将10.10.1.127服务器的数据库ORCL(WINDOWS)迁移到VM 10.10.10.168LINUX平台 操作系统:Windows server 2008r2 64bit CentOS  L ...

  2. Run nginx from Docker in Windows

    1.首先, 使用 docker run hello-world 命令 确认 docker 在本地安装成功,若成功应如下所示(此处使用的是 Docker Toolbox 在Windows上安装Docke ...

  3. js的浅拷贝和深拷贝和应用场景

    为什么会用到浅拷贝和深拷贝 首先来看一下如下代码 let a = b = 2 a = 3 console.log(a) console.log(b) let c = d = [1,2,3] let e ...

  4. 添加tomcat为启动服务/删除tomcat服务

    在很多生产把环境下,tomcat的启动要随着windows的启动一起启动,这个时候就需要将tomcat添加成服务.步骤如下: 1:环境配置 配置jdk环境变量: JAVA_HOME:jdk路径 配置p ...

  5. @清晰掉 GDB调试器中的战斗机

    GDB 的命令很多,本文不会全部介绍,仅会介绍一些最常用的.在介绍之前,先介绍GDB中的一个非常有用的功能:补齐功能.它就如同Linux下SHELL中的命令补齐一样.当你输入一个命令的前几个字符,然后 ...

  6. Redis cluster Specification 笔记

    ref: http://redis.io/topics/cluster-spec 1. 设计目标: 高性能:线性扩展:不支持合并操作:写操作安全:小概率丢弃:(对于每个key)只要有一个slave工作 ...

  7. 浏览器端-W3School:HTML DOM cells 集合

    ylbtech-浏览器端-W3School:HTML DOM cells 集合 1.返回顶部 1. HTML DOM cells 集合 HTML DOM Table 对象 定义和用法 cells 集合 ...

  8. MVC、MVP 和 MVVM

    MVC Model–View–Controller 模型:管理应用程序的数据.逻辑和规则 视图:展示数据(可以直接从模型中获取数据) 控制器:接收输入并将其转化成模型和视图的命令 MVP Model– ...

  9. 【工具安装】BurpSuite 安装教程

    日期:2019-07-14 17:23:53 介绍:安装 JDK,配置 JDK 的环境变量.安装 BurpSuite,抓包 0x01. 安装 JDK 安装 JDK BurpSuite 需要 JAVA ...

  10. Django开启https(不用nginx)

    首先安装需要用到的包 pip install django-extensions pip install django-werkzeug-debugger-runserver pip install ...