以 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. D. Treasure Island

    D. Treasure Island dfs大法好== 写半天bfs疯狂MLE dfs标记掉路上的一些点 然后再跑一遍dfs #include<bits/stdc++.h> using n ...

  2. 2.Python环境搭建Window、mac、linux

    1.Windows安装Python详解 使用任何高级编程语言都需要有一个自己的编程环境,Python 也不例外.只要使用 Python,就必须要配置 Python 的开发和运行环境. Python 本 ...

  3. git本地分支推送到远程分支

    1.创建的创建和初始化 创建git仓库可以在远端创建一个仓库, 然后check到本地,在本地的文件里创建工程文件,然后提交 也可以将本地现有的工程和远端的空仓库关联 本地创建了一个工程 iOSDemo ...

  4. tomcat8.5部署管理控制台

    1.修改 conf/tomcat-users.xml 文件 <role rolename="manager-gui"/> <role rolename=" ...

  5. [论文笔记] Fine-Grained Head Pose Estimation Without Keypoints

    Fine-Grained Head Pose Estimation Without Keypoints 简介 head pose estimation 经典论文,使用CNN预测三个角度值,pitch, ...

  6. Python深度学习读书笔记-1.什么是深度学习

    人工智能 什么是人工智能.机器学习与深度学习(见图1-1)?这三者之间有什么关系?

  7. Visual Studio Code - 同步代码时使用 rebase

    打开设置 设置"git.rebaseWhenSync": true

  8. java kryo序列化与反序列化

    https://blog.csdn.net/lan12334321234/article/details/84907492 问题: https://blog.csdn.net/baidu_384041 ...

  9. 异步 map 和模块打包

    概述 本文是我在查资料的时候学到的一些东西,记录下来,供以后开发时参考,相信对其他人也有用. 参考资料: 异步函数 - 提高 Promise 的易用性 深入 CommonJs 与 ES6 Module ...

  10. C 语言的函数 - 内存分析

    函数基本概念 Linux 中,函数在内存的代码段(code 区),地址比较靠前. 函数定义 C 语言中,函数有三个要素:入参.返回值.函数名,缺一不可.函数使用前必须先声明,或者在使用之前定义. 函数 ...