RedHat5安装Mysql5.1.7

[[email protected] ~]# cd /home/app/mysql

[[email protected] mysql]# ls

--解压

MySQL-community-5.1.73-1.rhel5.i386.rpm-bundle.tar

[[email protected] mysql]# tar -xvf MySQL-community-5.1.73-1.rhel5.i386.rpm-bundle.tar

MySQL-test-community-5.1.73-1.rhel5.i386.rpm

MySQL-embedded-community-5.1.73-1.rhel5.i386.rpm

MySQL-devel-community-5.1.73-1.rhel5.i386.rpm

MySQL-shared-compat-5.1.73-1.rhel5.i386.rpm

MySQL-shared-community-5.1.73-1.rhel5.i386.rpm

MySQL-server-community-5.1.73-1.rhel5.i386.rpm

MySQL-client-community-5.1.73-1.rhel5.i386.rpm

MySQL-community-debuginfo-5.1.73-1.rhel5.i386.rpm

--安装

[[email protected] mysql]# rpm -ivh *.rpm

Preparing...                ########################################### [100%]

1:MySQL-shared-community ########################################### [ 13%]

2:MySQL-devel-community  ########################################### [ 25%]

3:MySQL-client-community ########################################### [ 38%]

4:MySQL-community-debugin########################################### [ 50%]

5:MySQL-embedded-communit########################################### [ 63%]

6:MySQL-server-community ########################################### [ 75%]

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password ‘new-password‘

/usr/bin/mysqladmin -u root -h hqw.net password ‘new-password‘

Alternatively you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

Starting MySQL..[  OK  ]

Giving mysqld 2 seconds to start

7:MySQL-shared-compat    ########################################### [ 88%]

8:MySQL-test-community   ########################################### [100%]

--重置root密码

[[email protected] mysql]# /usr/bin/mysqladmin -u root -h hqw.net password ‘root‘

[[email protected] mysql]# /usr/bin/mysqladmin -u root password ‘root‘

--启动服务

[[email protected] mysql]# service mysql start

Starting MySQL                                             [  OK  ]

--root登录

[[email protected] mysql]# mysql -uroot -proot

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

Your MySQL connection id is 3

Server version: 5.1.73-community 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> select now();

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

| now()               |

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

| 2014-11-22 08:01:09 |

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

1 row in set (0.00 sec)

--新建远程账户

mysql> GRANT ALL PRIVILEGES ON *.* TO [email protected] IDENTIFIED BY ‘test‘ WITH GRANT OPTION;

Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO [email protected]"%" IDENTIFIED BY ‘test‘ WITH GRANT OPTION;

Query OK, 0 rows affected (0.00 sec)

--刷新权限

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> exit

--远程数据库用户登录

[[email protected] mysql]# mysql -utest -ptest

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

Your MySQL connection id is 4

Server version: 5.1.73-community 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> select now();

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

| now()               |

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

| 2014-11-22 08:02:36 |

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

1 row in set (0.00 sec)

mysql>

mysql> exit

Bye

[[email protected] mysql]# exit

logout

Last login: Sat Nov 22 07:53:02 2014 from 192.168.11.1

--copy主配置文件

[[email protected] ~]# cp /usr/share/mysql/my-huge.cnf  /etc/my.cnf

--往主配置文件添加 skip-name-resolve,skip-grant-tables为加快远程连接

--改动mysql的配置文件,在my.cnf中的[mysqld]下面(位置不能错)加上lower_case_table_name=1这句(1表示不区分大小写,0区分大小写),保存重新启动mysql

[[email protected] ~]# vi /etc/my.cnf

# Example MySQL config file for very large systems.

#

# This is for a large system with memory of 1G-2G where the system runs mainly

# MySQL.

#

# MySQL programs look for option files in a set of

# locations which depend on the deployment platform.

# You can copy this option file to one of those

# locations. For information about these locations, see:

# http://dev.mysql.com/doc/mysql/en/option-files.html

#

# In this file, you can use all long options that a program supports.

# If you want to know which options a program supports, run the program

# with the "--help" option.

# The following options will be passed to all MySQL clients

[client]

#password       = your_password

port            = 3306

socket          = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server

[mysqld]

lower_case_table_name=1

skip-name-resolve

skip-grant-tables

port            = 3306

socket          = /var/lib/mysql/mysql.sock

skip-locking

"/etc/my.cnf" 149L, 4748C written

[[email protected] ~]#

--设置防火墙允许3306端口

[[email protected] ~]# vi /etc/sysconfig/iptables

# Firewall configuration written by system-config-securitylevel

# Manual customization of this file is not recommended.

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

:RH-Firewall-1-INPUT - [0:0]

-A INPUT -j RH-Firewall-1-INPUT

-A FORWARD -j RH-Firewall-1-INPUT

-A RH-Firewall-1-INPUT -i lo -j ACCEPT

-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT

-A RH-Firewall-1-INPUT -p 50 -j ACCEPT

-A RH-Firewall-1-INPUT -p 51 -j ACCEPT

-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT

-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 1158 -j ACCEPT

-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 5560 -j ACCEPT

-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT

-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

"/etc/sysconfig/iptables" 25L, 1275C

# Firewall configuration written by system-config-securitylevel

# Manual customization of this file is not recommended.

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

:RH-Firewall-1-INPUT - [0:0]

-A INPUT -j RH-Firewall-1-INPUT

-A FORWARD -j RH-Firewall-1-INPUT

-A RH-Firewall-1-INPUT -i lo -j ACCEPT

-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT

-A RH-Firewall-1-INPUT -p 50 -j ACCEPT

-A RH-Firewall-1-INPUT -p 51 -j ACCEPT

-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT

-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 1158 -j ACCEPT

-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 5560 -j ACCEPT

-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT

-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

COMMIT

~

~

~

~

~

~

~

~

~

~

~

~

~

"/etc/sysconfig/iptables" 25L, 1275C written

--停止防火墙服务

[[email protected] ~]# service iptables stop

Flushing firewall rules:                                   [  OK  ]

Setting chains to policy ACCEPT: filter                    [  OK  ]

Unloading iptables modules:                                [  OK  ]

--开启防火墙服务

[[email protected] ~]# service iptables start

Applying iptables firewall rules:                          [  OK  ]

Loading additional iptables modules: ip_conntrack_netbios_n[  OK  ]

[[email protected] ~]#

--查看网络配置

[[email protected] ~]# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0C:29:0D:B0:9D

inet addr:192.168.11.6  Bcast:192.168.11.255  Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe0d:b09d/64 Scope:Link

UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

RX packets:121089 errors:0 dropped:0 overruns:0 frame:0

TX packets:65139 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:169113515 (161.2 MiB)  TX bytes:5457976 (5.2 MiB)

Interrupt:67 Base address:0x2000

lo        Link encap:Local Loopback

inet addr:127.0.0.1  Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING  MTU:16436  Metric:1

RX packets:7086 errors:0 dropped:0 overruns:0 frame:0

TX packets:7086 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:4800365 (4.5 MiB)  TX bytes:4800365 (4.5 MiB)

--远程连接

时间: 2024-11-06 09:50:43

RedHat5安装Mysql5.1.7的相关文章

redhat5 安装mysql 5.6

在官网找到下载链接 http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.19-1.rhel5.x86_64.rpm-bundle.tar wget下来 wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.19-1.rhel5.x86_64.rpm-bundle.tar 解压 tar -xvf MySQL-5.6.19-1.rhel5.x86_64.rpm-bundle.t

在centos6.5中安装mysql5.7

简介 博主最近在研究mysql的读写分离和主从复制,一台master和两台slave,三台机器在同一个局域网中,首先就就要在centos6.5中安装mysql5.7.好了,废话不多说,接下来进入正题. 一.解压缩到/usr/local/下面,mysql的主目录命名为mysql [[email protected] local]# cd /usr/local/soft/ [[email protected] soft]# tar zvxf mysql-5.7.10-linux-glibc2.5-i

RedHat6.6上安装MySQL5.7.13

由于公司需要更换新的架构,将采用MySQL5.7作为数据库的主要版本,下面将全面介绍在RedHat6.6上二进制安装MySQL5.7.13.后期也将依次介绍在MySQL5.7上的运维管理及优化. 1.下载MySQL5.7.13安装包 下载地址如下,现在的MySQL5.7稳定版已更新到5.7.14 http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.14-linux-glibc2.5-x86_64.tar.gz 2.新建MySQL用户和组

Centos7下配置安装mysql5.5主从复制(一主两从)

1:安装mysql5.5数据库 规划: 主:server-1---10.64.5.167 从:server-2---10.64.5.170 从:server-3---10.64.5.172 数据目录:/var/lib/mysql 下载mysql5.5 #wget   http://cdn.mysql.com//Downloads/MySQL-5.5/MySQL-client-5.5.46-1.el7.x86_64.rpm #wget   http://cdn.mysql.com//Downloa

Linux(Red Hat 6 32位) 下安装Mysql5.6.30

1. 下载MySQL 5.6 下载页面:http://dev.mysql.com/downloads/mysql/ 此处选择"Red Hat Enterprise Linux 6 / Oracle Linux 6 (x86, 32-bit), RPM Bundle"下载,下载至/root/fuxian/目录下,下载文件名为"MySQL-5.6.30-1.el6.i686.rpm-bundle.tar" 2. 解压tar包 cd /fuxian/Downloads/

linux上源码编译安装mysql-5.6.28

在 linux 上编译安装 mysql-5.6.28.tar.gz http://www.mysql.com/ mysql下载地址: http://www.mysql.com/downloads/mysql/#downloads mysql 官方网站文档: https://dev.mysql.com/doc/ 01.准备工作 yum install -y gcc gcc-c++ cmake make ncurses ncurses-devel bison 02.解压 tar zxf mysql-

开发人员学Linux(6):CentOS7编译安装MySQL5.17.8多实例及主从复制

1.前言上一篇讲述了如何在CentOS7下编译安装Nginx-1.12.0并如何配置反向代理,本篇将讲述如何编译安装MySQL5.7.18并配置多实例.2.准备2.1下载MySQL5.7.18源码注意最新版本的MySQL需要Boost才能编译安装,在MySQL提供的下载中有不带boost的源码,还有带boost的源码,如果下载不带boost的源码还需要再去下载boost源码,为省事起见,建议下载带boost的源码,下载地址:https://cdn.mysql.com//Downloads/MyS

cmake编译安装mysql5.5

CMAKE方式编译安装Mysql5.5 1.源码cmake方式编译安装MySQL5.5.32 安装前先安装: yum install ncurses-devel -y 1.1 下载Mysql和cmake安装包: wget http://wwwNaNake.org/files/v2.8/cmake-2.8.8.tar.gz 1.2 查看系统环境 cat /etc/redhat-release uname -r uname -m 1.3 安装cmake包 tar zxf cmake-2.8.8.ta

centos7.2安装mysql5.7.13

博主QQ:819594300 博客地址:http://zpf666.blog.51cto.com/ 有什么疑问的朋友可以联系博主,博主会帮你们解答,谢谢支持! 另外本博文内使用的全部软件和文件,博友如有需要可以去我百度云分享下载,分享地址是: 链接:http://pan.baidu.com/s/1bpaOqa7 密码:r2js 一.MySQL 5.7主要特性: 原生支持Systemd 更好的性能:对于多核CPU.固态硬盘.锁有着更好的优化 更好的InnoDB存储引擎 更为健壮的复制功能:复制带来