一、安装

1、首先下载安装包,包含服务端和客户端

2、添加用户组、用户

secondary1:~ # groupadd mysql

secondary1:~ # useradd -g mysql -d /home/mysql -s /bin/bash -m mysql

3、设置mysql用户的密码

secondary1:~ # passwd mysql

Changing password for mysql.

New Password:

Reenter New Password:

Password changed.

4、将安装包上传到mysql家目录,并执行安装

secondary1:~ # cd /home/mysql/

secondary1:/home/mysql # rz

z waiting to receive.**B0100000023be50

secondary1:/home/mysql # ll MySQL*

-rw-r--r-- 1 root root 16835057 Jun 4 09:16 MySQL-client-5.6.16-1.sles11.x86_64.rpm

-rw-r--r-- 1 root root 49883518 Jun 4 09:33 MySQL-server-5.6.16-1.sles11.x86_64.rpm

secondary1:/home/mysql # rpm -ivh MySQL-server-5.6.16-1.sles11.x86_64.rpm
secondary1:/home/mysql # rpm -ivh MySQL-client-5.6.16-1.sles11.x86_64.rpm
5、启动mysql服务端

secondary1:/home/mysql # /etc/init.d/mysql start

Starting MySQL. done

secondary1:/home/mysql #

6、设置root用户密码

mysql的默认用户root的密码保存在/root/.mysql_secret,

secondary1:/home/mysql # cat /root/.mysql_secret

The random password set for the root user at Thu Jun 4 15:32:31 2015 (local time): e3Do1iml

secondary1:/home/mysql # mysqladmin -uroot -pe3Do1iml password Atae1234

Warning: Using a password on the command line interface can be insecure.

secondary1:/home/mysql #

7、设置mysql不区分大小写

secondary1:/home/mysql # echo "lower_case_table_names=1" >> /usr/my.cnf

8、重启mysql服务端

secondary1:/home/mysql # /etc/init.d/mysql restart

Shutting down MySQL.. done

Starting MySQL. done

secondary1:/home/mysql #

9、修改mysql的连接

secondary1:/home/mysql # mysql -uroot -p'Atae1234'

Warning: Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.6.16 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, 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> update mysql.user set host = '%' where host = 'localhost';

Query OK, 1 row affected (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 0

mysql> delete from mysql.user where host = 'secondary1';

Query OK, 1 row affected (0.02 sec)

mysql> delete from mysql.user where host = '::1';

Query OK, 1 row affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql>

二、卸载

secondary1:/home/mysql # rpm -qa|grep mysql -i | xargs -i rpm -e {} --nodeps

insserv: script kdump: service boot.kdump already provided!

insserv: warning: current start runlevel(s) (3 5) of script `corosync' overwrites defaults (empty).

insserv: warning: script 'init.ohasd' missing LSB tags and overrides

insserv: Default-Start undefined, assuming default start runlevel(s) for script `init.ohasd'

mysql 0:off 1:off 2:off 3:off 4:off 5:off 6:off

secondary1:/home/mysql # rm -rf /var/lib/mysql

secondary1:/home/mysql # rm -f /usr/my.cnf

secondary1:/home/mysql # cd

secondary1:~ # userdel -rf mysql

no crontab for mysql

secondary1:~ # groupdel mysql

【其他】MySql数据库的安装与卸载的更多相关文章

  1. MySQL 数据库的安装与卸载

    一.安装 (1)打开下载的 mysql 安装文件双击解压缩,运行“mysql-5.5.40-win32.msi” (2)选择安装类型, 有“Typical(默认) ”. “Complete(完全) ” ...

  2. 关于MySQL数据库的安装和卸载

    0.官网下载 https://www.mysql.com/ 选择需要的版本下载 两种安装方式,选择需要的安装包 下载 1.MySQL 5.6 for Windows 解压缩版配置安装 https:// ...

  3. MySql数据库的安装和卸载

  4. [转] Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置

    from:  http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得 ...

  5. Linux学习之CentOS--CentOS6.4下Mysql数据库的安装与配置【转】

      如果要在Linux上做j2ee开发,首先得搭建好j2ee的开发环境,包括了jdk.tomcat.eclipse的安装(这个在之前的一篇随笔中已经有详细讲解了Linux学习之CentOS(七)--C ...

  6. Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置

    原文:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建好j ...

  7. Linux学习之CentOS6下Mysql数据库的安装与配置

    转自:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建好j ...

  8. Linux CentOS6.4下Mysql数据库的安装与配置

    一.mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库,咱 ...

  9. CentOS6.4/6.7下Mysql数据库的安装与配置(转载)

    通过RPM方式 给centos  安装mysql  最好有光盘,呵呵,网络也可以下载rpm安装包,不过文件较大. 1 挂载光盘 mount /dev/cdrom /mnt/cdrom/mount: b ...

随机推荐

  1. linuxlab下虚拟板与主机通信

  2. 在VMware上安装CentOS -7步骤详解

    在VMware上安装CentOS -7 一.下载好VMware虚拟机 二.准备好CentOS的镜像文件 在这里安装之前博主都已准备好了. 废话就少啰嗦啦!现在开始安装步骤了 1.首先打开VMware创 ...

  3. XTU 1250 Super Fast Fourier Transform

    $2016$长城信息杯中国大学生程序设计竞赛中南邀请赛$H$题 排序,二分. 对$a$数组,$b$数组从小到大进行排序. 统计每一个$a[i]$作为较大值的时候与$b[i]$对答案的贡献.反过来再统计 ...

  4. java 调用打印机 打印服务

    import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import javax ...

  5. MySQL安装之zip格式

    背景: 今天本来想学点JDBC的,没想到在MySQL的安装上卡了很久,特此写下此文,希望大家遇到类似问题可以早些跳出坑.   一.寻找资源 今天,为了学习JDBC,准备在公司的电脑上装MySQL,于是 ...

  6. OGC 的WCS WFS 及WMS 服务

    OGC--Open Geospatial Consortium--开放地理信息联盟,是一个非盈利的志愿的国际标准化组织,引领着空间地理信息标准及定位基本服务的发展目前在空间数据互操作领域,基于公共接口 ...

  7. 解决asp.net中“从客户端中检测到有潜在危险的Request.Form值”的错误

    修改Web.config,增加requestValidationMode="2.0"属性值 <system.web> <httpRuntime requestVa ...

  8. Linux Kernel Vhost 架构

    Vhost 回顾 Linux中的vhost驱动程序提供了内核virtio设备仿真. 通常,QEMU用户空间进程模拟guest的I / O访问. Vhost将virtio仿真代码放到内核中,使QEMU用 ...

  9. redhat nginx 启动脚本

    #!/bin/sh # # nginx - this script starts and stops the nginx daemin # # chkconfig: - 85 15 # descrip ...

  10. Myeclipse10、Maven构建Javaweb项目

    主要介绍如何使用 Myeclipse 10 构建 Maven Web 项目,关于 Maven 的介绍就略过了. 工具/原料   myeclipse apache-maven-3.1.0 方法/步骤   ...