Mysql单实例的安装配置指南

实验环境:

操作系统:CentOS 6.8

虚拟机:VMware 

数据库:mysql-5.1.62.tar.gz

安装步骤:

#wget  http://soft.vpser.net/datebase/mysql/mysql-5.1.62.tar.gz

#tar  zxf mysql-5.1.62.tar.gz

[[email protected] mysql-5.1.62]#./configure  \

--prefix=/usr/local/mysql \

--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \

--localstatedir=/usr/local/mysql/data \

--enable-assembler \

--enable-thread-safe-client \

--with-mysqld-user=mysql \

--with-big-tables \

--without-debug \

--with-pthread \

--enable-assembler \

--with-extra-charsets=complex \

--with-readline \

--with-ssl \

--with-embedded-server \

--enable-local-infile \

--with-plugins=partition,innobase \

--with-mysqld-ldflags=-all-static \

--with-client-ldflags=-all-static

/bin/rm: cannot remove `libtoolT‘: No such file or directory

config.status: executing default commands

Thank you for choosing MySQL!

Remember to check the platform specific part of the reference manual

for hints about installing MySQL on your platform.

Also have a look at the files in the Docs directory.

[[email protected] mysql-5.1.62]##make

[[email protected] mysql-5.1.62]##make install

[[email protected] mysql-5.1.62]# ls -l support-files/*.cnf

[[email protected] mysql-5.1.62]# /bin/cp support-files/my-small.cnf /etc/my.cnf

[[email protected] mysql-5.1.62]# cat /etc/my.cnf

[[email protected] mysql-5.1.62]# mkdir -p /usr/local/mysql/data

[[email protected] mysql-5.1.62]# chown -R mysql /usr/local/mysql

[[email protected] mysql-5.1.62]# /usr/local/mysql/bin/mysql_install_db --user=mysql

[[email protected] mysql-5.1.62]# chmod -R 777 /tmp/

#启动mysql数据库

[[email protected] mysql-5.1.62]# cp support-files/mysql.server /usr/local/mysql/bin

[[email protected] mysql-5.1.62]# chmod 700 /usr/local/mysql/bin/mysql.server

[[email protected] mysql-5.1.62]# /usr/local/mysql/bin/mysql.server start   #启动数据库的方法之一

Starting MySQL. SUCCESS!

[[email protected] mysql-5.1.62]# netstat -lnt|grep 3306

[[email protected] mysql-5.1.62]# /usr/local/mysql/bin/mysql.server stop

Shutting down MySQL... SUCCESS!

#配置全局路径

[[email protected] mysql-5.1.62]# echo ‘export PATH=$PATH:/usr/local/mysql/bin‘ >> /etc/profile

#source /etc/profile

#配置/etc/init.d/mysqld start方式启动数据库方法之二

[[email protected] mysql-5.1.62]# cp support-files/mysql.server /etc/init.d/mysqld

[[email protected] mysql-5.1.62]# chmod 700 /etc/init.d/mysqld

[[email protected] mysql-5.1.62]# /etc/init.d/mysqld restart

Shutting down MySQL... SUCCESS!

Starting MySQL. SUCCESS!

[[email protected] mysql-5.1.62]# /etc/init.d/mysqld restart

Shutting down MySQL..... SUCCESS!

Starting MySQL. SUCCESS!

可以使用如下三种命令登录:

mysql -uroot -p,mysql -uroot,mysql -uroot -p ‘密码‘

mysql安装完成后,默认情况下,管理员帐号root是无密码的。

为root增加密码:

[[email protected] mysql-5.1.62]# mysqladmin -u root password  ‘skyboy‘

[[email protected] mysql-5.1.62]# mysql

ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)

mysql> select user,host from mysql.user;

+------+-----------------+

| user | host            |

+------+-----------------+

| root | 127.0.0.1       |

|      | localhost       |

| root | localhost       |

|      | www.sky9890.com |

| root | www.sky9890.com |

+------+-----------------+

#下面删除多余账号:

mysql> drop user ‘‘@localhost;

Query OK, 0 rows affected (0.00 sec)

mysql> drop user ‘‘@www.sky9890.com;

mysql> drop user ‘root‘@www.sky9890.com;

Query OK, 0 rows affected (0.00 sec)

时间: 2024-08-23 15:55:06

Mysql单实例的安装配置指南的相关文章

mysql单实例的安装和简单配置(5.1.*版本)

1.创建mysql帐号 useradd -M -s /sbin/nologin -u 49 mysql 执行过程: [[email protected] ~]# useradd -M -s /sbin/nologin -u 49mysql [[email protected] ~]# cat /etc/passwd | grep mysql mysql:x:49:500::/home/mysql:/sbin/nologin 参数说明: -M 不创建mysql家目录 -s 指定mysql登录的sh

mysql单实例安装配置指南

1.操作系统:CentOS 2.数据库: mysql-5.1.73.tar.gz 3.任务:单实例安装配置指南 提示:下载数据库有两种方式:一种是官网,另一种途径是国内镜象网站:国内镜象下载资源的速度比官网要快,例如,我们这次下载的就是国内搜狐镜象: http://mirrors.sohu.com/mysql/MySQL-5.1/ http://mirrors.sohu.com/ 整个安装过程: [[email protected] tools]#wget http://mirrors.sohu

MySQL 5.6对已有Mysql单实例的机器,再添加mysql数据库,实现单机多实例

一.需求: 对已有Mysql单实例的机器,再添加两个mysql数据库,实现单机多实例. 一个绑定在端口3306,另外两个绑定在端口3307,3308: 数据分别存放在/data/mysqldata./data/mysqldata2./data/mysqldata3 三个实例均采用InnoDB作为默认的存储引擎,字符编码采用UTF-8: 三个实例均采用相同的性能优化配置参数: MySQL的源码安装请看我的另一篇博客http://yylinux.blog.51cto.com/8831641/1677

[转载]SharePoint 2013测试环境安装配置指南

软件版本 Windows Server 2012 标准版 SQL Server 2012 标准版 SharePoint Server 2013 企业版 Office Web Apps 2013 备注:安装之前,需要各个服务器的IP地址,机器名称设置好,并且已经加入到域中. 一 安装AD域控制器 1. 添加AD服务 a) 打开服务器管理器,选择[添加角色和功能] b) 在[开始之前]页面直接点击[下一步] c) 选择[基于角色或基于功能的安装]后,点击[下一步] d) 选择[从服务器池中选择服务器

MySQL单实例重置密码的两种方法

MySQL单实例重置密码的两种方法 在工作学习中,我们有时会忘记数据库的密码,下面是MySQL单实例密码重置的步骤. 说明: (1)[[email protected] ~]# cat /etc/redhat-release CentOS release 6.7 (Final) (2)[[email protected] ~]# mysql --version mysql  Ver 14.14 Distrib 5.7.13, for Linux (i686) using  EditLine wr

单实例数据库安装脚本

安装脚本 1.1_preusers.sh #!/bin/bash #Purpose:Create 3 groups named 'oinstall','dba','oper', plus 1 users named 'oracle'. #Also setting the Environment #variable for oracle user. #Usage:Log on as the superuser('root'),and then execute the command:#./1pre

mysql5.6.27压缩版安装配置指南【个人总结】

mysql5.6.27压缩版安装配置指南[个人总结] 1..下载准备压缩包 360云盘下载地址: https://yunpan.cn/cPKyugkUcDEmP  访问密码 375b 2.解压缩,将压缩版解压到D盘 D:\mysql-5.6.27-winx64 3.修改配置文件 my-default.ini #my-default.ini文件的编码必须是英文编码(如windows中的ANSI),不能是UTF-8或GBK等 # For advice on how to change setting

mysql 5.7.13 安装配置方法图文教程(win10) (转)

http://www.jb51.net/article/87152.htm ***************************** MySQL是一款关系型数据库管理系统,是由Oracle旗下公司MySQL AB 公司开发,是在web方面最好的.最流行的关系型数据库软件应用之一,深受广大个人使用者以及中小型企业的喜爱. 方法/步骤 双击安装文件,进入安装,如图所示,点击“next”,进入下一步 在协议许可(LicenseAgreement)界面,勾选“Iacceptthelicenseterm

MYSQL + MHA +keepalive + VIP安装配置(三)--keepalived安装配置

一.概述 keepalived介绍:Keepalived的作用是检测web服务器的状态,如果有一台web服务器死机,或工作出现故障,Keepalived将检测到,并将有故障的web 服务器从系统中剔除,当web服务器工作正常后Keepalived自动将web服务器加入到服务器群中,这些工作全部自动完成,不需要人工干涉,需要人 工做的只是修复故障的web服务器. 二.环境 ? 1 2 3 vip:192.168.1.203\204 mysql-master:192.168.1.231 mysql-