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 ...
随机推荐
- Burp suite抓取HTTPS请求
一.下载链接:Burp suite 密码:orpr 二.抓取浏览器HTTPS请求 1.打开CMD,进入到Burp suite下载路径,执行:java -jar BurpLoader.jar 2.点击 ...
- (转载)FM 算法
(转载)FM算法 https://zhuanlan.zhihu.com/p/33184179
- react注
创建新项目: npm create-react-app test1 运行项目:npm start
- socket基本概念
1.socket 是什么? 在计算机通信领域,socket 被翻译为“套接字”,它是计算机之间进行通信的一种约定或一种方式.通过 socket 这种约定,一台计算机可以接收其他计算机的数据,也可以向其 ...
- uncaught syntaxerror unexpected token U JSON
uncaught syntaxerror unexpected token U JSON The parameter for the JSON.parse may be returning nothi ...
- 修改win10 capslock键成esc键 vim
桌面编辑一个文件CapsLock2Esc.reg Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentCont ...
- kafka 通信报文格式
1. 序列化一条消息 消息有 key 和 value kafka 提供了基础数据类型的序列化工具,对于业务的自定义类需要自行实现序列化 ProducerRecord 是对象,含 KV 和 header ...
- Application.CreateForm()和TForm.Create()创建的窗体有什么区别么?二者在使用上各有什么技巧?(50分)
https://wedelphi.com/t/135849/ 请详细些,并给出例子.谢谢. Application.CreateForm()创建的第一个可显示的窗体是自动成为主窗体,并且自动显示,并且 ...
- 【AOP】操作相关术语---【Spring】的【AOP】操作(基于aspectj的xml方式)
[AOP]操作相关术语 Joinpoint(连接点):类里面哪些方法可以被增强,这些方法称为连接点. Pointcut(切入点):在类里面可以有很多的方法被增强,比如实际操作中,只是增强了类里面add ...
- Matlab 文件格式化/Matlab Source File Formattor
由于需要使用到别人编写的Matlab代码文件,但是呢不同的人有不同的风格,有的写得就比较糟糕了. 为了更好地理解代码的内容,一个比较美观的代码会让人身心愉悦. 但是在网上并没有找到一个比较好的实现,此 ...