linux 建立 MySQL 账号
以 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 账号的更多相关文章
- linux下Mysql 的安装、配置、数据导入导出
MySQL是一种开放源代码的关系型数据库管理系统(RDBMS),虽然功能未必很强大,但因它的免费开源而广受欢迎. 这次,接着上一篇<CentOs minimal安装和开发环境部署>,讲下L ...
- Linux系统——MySQL基础(二)
# MySQL数据库完全备份与恢复## 数据库备份的分类1. 从物理与逻辑的角度,备份可以分为物理备份和逻辑备份.(1)物理备份:对数据库操作系统的物理文件(数据文件.日志文件)的备份.物理备份又可分 ...
- [分享]运维分享一一阿里云linux系统mysql密码修改脚本
[分享]运维分享一一阿里云linux系统mysql密码修改脚本 大象吃豆子 级别: 小白 发帖 12 云币 27 加关注 写私信 只看楼主 更多操作楼主 发表于: 2014-09-3 ...
- LNMP(linux+nginx+mysql+php)服务器环境配置
一.简介 Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx,它的发音为 “engine X”, 是一个高性能的HTTP和反向代理服务器,同时也是一个IMAP/POP3/SMTP 代理服 ...
- (转)mysql账号权限密码设置方法
原文:http://www.greensoftcode.net/techntxt/2013410134247568042483 mysql账号权限密码设置方法 我的mysql安装在c:\mysql 一 ...
- linux下MySQL安装登录及操作
linux下MySQL安装登录及操作 二.安装Mysql 1.下载MySQL的安装文件 安装MySQL需要下面两个文件: MySQL-server-4.0.16-0.i386.rpm MySQL-cl ...
- Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)
Centos下安装配置LAMP(Linux+Apache+MySQL+PHP) 关于LAMP的各种知识,还请大家自行百度谷歌,在这里就不详细的介绍了,今天主要是介绍一下在Centos下安装,搭建一 ...
- [转] Ubuntu 12.04下LAMP安装配置 (Linux+Apache+Mysql+PHP)
我是一个Linux新手,想要安装一台Ubuntu 12.04版的Linux服务器,用这台服务器上的LAMP套件来运行我自己的个人网站.LAMP套件就是 “Linux+Apache+Mysql+PHP这 ...
- linux下mysql的卸载、安装全过程
卸载mysql 1.查找以前是否装有mysql 命令:rpm -qa|grep -i mysql 可以看到mysql的两个包: mysql-4.1.12-3.RHEL4.1 mysqlclient10 ...
随机推荐
- 损坏的RAID5
损坏的RAID5 string讀入卡cin 関同步 ios::sync_with_stdio(false) 由塊號映射到具體位置 塊號id對應第col個字符串 字符串開始的位置st #include& ...
- UIImage非正方形图片如何剪切为正方形
有时候项目里做头像上传时候,必须要把用户从相册或是相机里的选择的图片剪切为指定大小的图片,遇到太大,太小或是太长的图片就需coregraphic来对图片进行剪切 废话不多说,直接上代码 /** * 剪 ...
- 运行Spark官方提供的例子
去spark官网把spark下载下来: https://spark.apache.org/downloads.html 解压,可以看下目录: 其中examples目录下提供了java,scala,py ...
- 火狐firefox进行post提交测试
1,打开火狐浏览器,将测试url复制到地址栏.按F12,进行连接. 2,点击连接:再点击“编辑与重发” 3,请求头中加入如下一行: Content-Type: application/json; ch ...
- LeetCode_001.两数之和
LeetCode_001 LeetCode-001.两数之和 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那两个整数,并返回他们的数组下标. 你可以假设每种输 ...
- 下载vuejs,Hello Vue(vscode)
下载vuejs,Hello Vue(vscode) Hello Vue 下载使用vue.js 动图演示 Vue的基本使用步骤 传送门:https://cn.vuejs.org/v2/guide/in ...
- mysql命令使用3
算术运算函数 sum()求和 mysql> select sum(price) from books;+------------+| sum(price) |+------------+| 10 ...
- 无人驾驶车辆路径跟踪的增量式PID控制
路径跟踪是无人车研究方向的一项关键技术.路径跟踪控制算法是指能够使无人车按照预设路径,安全稳定行驶的控制方法. 建立无人车路径跟踪模型 预设无人车在A.B两点间,当前位置为D点,航向为hF 可以得到B ...
- SAAS方法论
内容来源:https://12factor.net/ 如今,软件通常会作为一种服务来交付,它们被称为网络应用程序,或软件即服务(SaaS).12-Factor 为构建如下的 SaaS 应用提供了方法论 ...
- Excel公式的常见错误值及其解决方法
Excel公式的常见错误值及其解决方法 经常用Excel的朋友可能都会遇到一些莫名奇妙的错误值信息:# N/A!.#VALUE!.#DIV/O!等等,出现这些错误的原因有很多种,如果公式不能计算正确结 ...