一、安装

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. centos 6.5 安装composer

    1.下载composer curl -sS https://getcomposer.org/installer | php ps:如果出现php无法运行的情况,请先把PHP加入环境变量,具体操作参考& ...

  2. svn自动备份并上传到ftp

    .建立bat文件 simpleBackup.bat,文件内容如下 @echo 正在备份版本库%1......@%SVN_HOME%bin\svnadmin hotcopy %1 %BACKUP_DIR ...

  3. Chapter 18_0 数学库

    从今天起,开始接触Lua的标准库(数学库.table库.字符库.I/O库.操作系统库.调试库). 一路走来,从最基本的变量.函数.迭代器.协同程序到稍微复杂的元表.元方法.环境.模块,以及最后被整蒙了 ...

  4. python 3.5构建WINDOWS推送服务

    import ConfigParser import os import sys cf = ConfigParser.ConfigParser() #绝对路径获取 ABSPATH=os.path.ab ...

  5. emguCv3.x 实现字符分割,轮廓检测

    /// <summary> /// 获取区域 /// </summary> /// <param name="bitmap"></para ...

  6. HDU 4262 Juggler

    点我看题 初步想法是模拟,找到下一个位置并记录操作数,O(n^2)肯定会超时. 那么进行优化,会发现到下一位置的操作数就是两个位置之间存在的数的个数,于是就变成了计数问题. 不难想到用树状数组或线段树 ...

  7. some links

    rename user: http://www.cyberciti.biz/faq/howto-change-rename-user-name-id/

  8. mybatis xml的无效判空

    <insert id="insert"> <if test="xxxMappingEntityList != null and xxxMappingEn ...

  9. jQuery(4)—— jQuery中的事件

    jQuery中的事件 [加载DOM] 在常规的JavaScript代码中,通常使用window.onload方法,在jQuery中,使用的是$(document).ready()方法.极大地提高了we ...

  10. BCTF Web Code–考脑洞,你能过么?

    BCTF Web Code–考脑洞,你能过么? 1)打开链接,是一张图片 根据URL特点推断可能是有文件包含漏洞 2) 将jpg参数修改成index.php,查看源代码,发现base64编码后的代码 ...