磨砺技术珠矶,践行数据之道,追求卓越价值 
回到上一级页面: PostgreSQL杂记页     回到顶级页面:PostgreSQL索引页 
[作者 高健@博客园  luckyjackgao@gmail.com]

1)下载:

在mysql的网站上,下载  mysql-5.6.13-linux-glibc2.5-x86_64.tar.gz

比如拷贝到 /soft/mysql5/ 目录下。

2)解压:

[root@server local]#cd /usr/local
[root@server local]#tar zxvf /soft/mysql5/mysql-5.6.13-linux-glibc2.5-x86_64.tar.gz

3)建立软链接:

[root@server local]#ln -s mysql-5.6.13-linux-glibc2.5-x86_64 mysql

查看:

[root@server local]# ls -lrt mysql
       lrwxrwxrwx 1 root root 36 9月 12 13:22 mysql -> ./mysql-5.6.13-linux-glibc2.5-x86_64
       [root@server local]#

4)建立mysql相关的用户和组:

[root@server local]#groupadd mysql
[root@server local]#useradd -r -g mysql mysql

5)生成数据库:

[root@server local]# cd mysql
[root@server local]# chown -R mysql .
[root@server local]#chgrp -R mysql .
[root@server local]# scripts/mysql_install_db --user=mysql
[root@server local]# chown -R root .
[root@server local]# chown -R mysql data

6)拷贝必要的文件(此为可选步骤):

[root@server local]#cp support-files/mysql.server /etc/init.d/mysql.server

7)启动数据库:

[root@server local]bin/mysqld_safe --user=mysql &

8)访问数据库:

[root@server ~]# mysql --user=mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.13 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.00 sec)

mysql> quit
Bye
[root@server ~]#

9)关闭数据库时,发现无法关闭数据库,于是强制关闭进程,然后退出。

10)设置权限:

重新启动数据库(带 --skip-grant-tables参数):

[root@server ~]# mysqld_safe --skip-grant-tables &
[1] 3140
[root@server ~]# 130912 14:49:51 mysqld_safe Logging to '/usr/local/mysql/data/server.gao.err'.
130912 14:49:51 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

设置root用户的口令(被要求Enter password的时候,直接按回车键就过去了):

[root@server ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.13 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=password("abcdef") where user='root' and host='localhost';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye
[root@server ~]#

为了验证是否可以正常关闭,再次重新启动来看一下:

[root@server ~]# mysqld_safe --skip-grant-tables
130912 14:57:36 mysqld_safe Logging to '/usr/local/mysql/data/server.gao.err'.
130912 14:57:36 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

[root@server ~]#

然后运行:

[root@server ~]# mysqladmin -uroot shutdown
[root@server ~]#

成功关闭。

下一次,完全正常启动,看能否关闭:

[root@server ~]# mysqld_safe
130912 15:01:26 mysqld_safe Logging to '/usr/local/mysql/data/server.gao.err'.
130912 15:01:26 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

[root@server ~]# mysqladmin -uroot -p shutdown
Enter password:
[root@server ~]#

关闭成功了。

[作者 高健@博客园  luckyjackgao@gmail.com]
回到上一级页面: PostgreSQL杂记页     回到顶级页面:PostgreSQL索引页 
磨砺技术珠矶,践行数据之道,追求卓越价值

Linux5下安装MySQL过程记录的更多相关文章

  1. 安装 MySQL 过程记录

    最近安装 MySQL 时 遇到了许多问题,记录一下安装过程以及遇到的问题. 第一步:在官网上下载适合自己版本的 MySQL,我选择的是 Windows 64 位免安装版的:    官网地址:https ...

  2. PPAS下安装 pg_stat_statements过程记录

    磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面: PostgreSQL统计信息索引页     回到顶级页面:PostgreSQL索引页 PostgreSQL中,如何安装pg_stat_sta ...

  3. linux5.8安装oracle10g过程记录,换实例一定要改profile的配置

    查看系统位数: [root@oracle /]# uname -aLinux oracle 2.6.18-308.el5 #1 SMP Fri Jan 27 17:21:15 EST 2012 i68 ...

  4. CentOS 6.5 安装mysql 过程记录

    下载的时候一定选对应的版本, el6 还是el7 或者其他版本,不然会出现意向不到的惊喜 比如:我刚开始的时候下载的 el7 版本的 mysql , 然后安装的时候 就会出现: libc.so.(GL ...

  5. windows下安装mysql笔记

    接着上几篇文章再来看下windows下安装mysql. 我这里是windows7 64位, 安装过程中还是遇到一些坑,这里记录下. 一.下载安装包 打开mysql官网下载页面:http://dev.m ...

  6. 配置apache,及mac下安装mysql

    先打开apache,在浏览器上输入  localhost     回车后会如果屏幕上显示:It works! 如下图: 这说明你的apache已开启 在window下配置apache: 1.找到apa ...

  7. mac 初次配置apache,及mac下安装mysql

    先打开apache,在浏览器上输入  localhost     回车后会如果屏幕上显示:It works! 如下图: 这说明你的apache已开启 mac 下apache配置(mac自带apache ...

  8. Mysql系列三:Centos6下安装Mysql和Mysql主从复制的搭建

    一.Centos6下安装Mysql 检测下系统有没有自带的mysql:yum list installed | grep mysql, 如果已经有的话执行命令yum -y remove mysql-l ...

  9. 在Ubuntu 18.04 下安装mysql,没有初始密码,重设root密码

    在Ubuntu 18.04 下安装mysql 不知道是由于mysql更新为新版还是.Ubuntu18.04中的特性,安装过程中没有设置密码的环节,在网络上找了半天,总算解决了!特此记录下来,以便以后查 ...

随机推荐

  1. [WSUS] Windows Server Update Service 更新后,出现错误不能连接

    执行以下命令:C:\Program Files\Update Services\Tools\wsusutil postinstall /servicing 参考:http://www.urtech.c ...

  2. Linux内存管理(text、rodata、data、bss、stack&heap)

    一.各内存区段的介绍 系统内的程序分为程序段和数据段,具体又可细分为一下几个部分: (1)text段-代码段 text段存放程序代码,运行前就已经确定(编译时确定),通常为只读,可以直接在ROM或Fl ...

  3. python_循环(迭代)

    #for 和 while #for用来迭代处理,什么叫迭代?你就当没看到这个词,for是把一堆玩意做一个一个加工用的,比如吃一袋花生,得一个一个剥吧,就是这意思 a = 'abcde' #每个字母当做 ...

  4. 定制controller转场动画

    定制controller转场动画 从iOS7开始就可以自由定制控制器间的转场动画了,以下实例描述最简单的定制方式,达到的效果如下所示: 为了实现这个效果需要这么多的文件-_-!!!! RootView ...

  5. 使用FastCoder写缓存单例

    使用FastCoder写缓存单例 FastCoder可以存储字典,数组,鄙人将FastCoder封装,CoreData可以缓存的东西,用这个都可以缓存,但是只适合缓存少量的数据(不适合存储几万条数据) ...

  6. Django学习---抽屉热搜榜分析【all】

    Python实例---抽屉热搜榜前端代码分析 Python实例---抽屉后台框架分析 Python学习---抽屉框架分析[点赞功能分析] Python学习---抽屉框架分析[数据库设计分析]18031 ...

  7. Python学习---Python的异步IO[all]

    1.1.1. 前期环境准备和基础知识 安装: pip3 install aiohttp pip3 install grequests pip3 install wheel pip3 install s ...

  8. php 导出

    //导出 //放在model层的类 <?phpnamespace frontend\models; use yii\base\model; /** * @copyright (c) 2014 a ...

  9. mysql8.0 安装

    之前一直使用的是zabbix3.4和mariadb5.5;感觉良好!!!但是...因其他原因需要重新部署 这次规划使用zabbix4.0和mysql8.0结合使用:嗯~~应该不会错吧!!! zabbi ...

  10. mysql的表和数据类型

    一.查看当前数据库所有表 mysql> use db Database changed mysql> show tables; Empty set (0.00 sec) #表示db数据库下 ...