以 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. Spring Boot教程(二十二)使用Swagger2构建强大的RESTful API文档(1)

    由于Spring Boot能够快速开发.便捷部署等特性,相信有很大一部分Spring Boot的用户会用来构建RESTful API.而我们构建RESTful API的目的通常都是由于多终端的原因,这 ...

  2. 【Mark】博弈类题目小结(HDU,POJ,ZOJ)

    转载请注明出处,谢谢http://blog.csdn.net/ACM_cxlove?viewmode=contents    by---cxlove 首先当然要献上一些非常好的学习资料: 基础博弈的小 ...

  3. Linux系统设置开机自动启动ORACLE数据库服务

    具体方法如下: 1. 修改oratab (root用户执行) /etc/oratab的配置格式如下: $ORACLE_SID:$ORACLE_HOME:Y 2. 测试dbstart, dbstop(o ...

  4. Windows Server 部署WEB API时内部错误

    Windows Server 部署WEB API时,发生HTTP 错误 500.21 - Internal Server Error,如图所示: 错误原因:IIS注册Framework4.0 解决方法 ...

  5. Vue中基本指令用法

    指令在Vue中是个很重要的功能,在Vue项目中是必不可少的.根据官网的介绍,指令 (Directives) 是带有 v- 前缀的特殊属性.指令的职责是,当表达式的值改变时,将其产生的连带影响,响应式地 ...

  6. PHP通用后台管理系统发布!

    下载地址:https://gitee.com/lim2018/phpadmin

  7. material of DeepLearning

    下面这个链接是深度学习相关的资料,内含很多dl的链接资料: http://blog.csdn.net/augusdi/article/details/20238157 MIT Deep Learnin ...

  8. PixelShuffle

  9. group by 与 order by 一起使用的时候

    select 后面的列+order by 后面的列 必须在group by 里面 也就是说 select 和 order by 后面的列是 group by 列的子集 而 select 和 order ...

  10. 微信小程序的 音频 组件

    audio:音频组件, api 接口为 wx.createInnerAudioContext audio 组件的属性: id:类型 字符串 audio 组件的唯一标识 src:类型 字符串 要播放音频 ...