• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • MsSql
  • Mysql
  • oracle
  • MariaDB
  • DB2
  • SQLite
  • PostgreSQL
  • MongoDB
  • Redis
  • Access
  • 数据库其它
  • sybase
  • HBase
您的位置:首页 > 数据库 >Mysql > RedHat5安装Mysql5.1.7

RedHat5安装Mysql5.1.7

作者:匿名 字体:[增加 减小] 来源:互联网 时间:2018-12-05

匿名通过本文主要向大家介绍了Mysql等相关知识,希望本文的分享对您有所帮助
[root@hqw ~]# cd /home/app/mysql
[root@hqw mysql]# ls

--解压
MySQL-community-5.1.73-1.rhel5.i386.rpm-bundle.tar
[root@hqw 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

--安装
[root@hqw 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密码
[root@hqw mysql]# /usr/bin/mysqladmin -u root -h hqw.net password 'root'
[root@hqw mysql]# /usr/bin/mysqladmin -u root password 'root'

--启动服务
[root@hqw mysql]# service mysql start
Starting MySQL [ OK ]

--root登录
[root@hqw 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 test@localhost IDENTIFIED BY 'test' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO test@"%" 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

--远程数据库用户登录
[root@hqw 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
[root@hqw mysql]# exit
logout
Last login: Sat Nov 22 07:53:02 2014 from 192.168.11.1

--copy主配置文件
[root@hqw ~]# 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

[root@hqw ~]# 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
[root@hqw ~]#

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

[root@hqw ~]# 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 R

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

相关文章

  • 2018-12-05Access使用宏控制程序 4.常用的宏操作
  • 2017-05-11Mysql的语句生成后门木马的方法
  • 2018-12-05mysql 显示SQL语句执行时间的代码
  • 2018-12-05MySQL数据库锁定机制的介绍
  • 2017-05-11在Win下mysql备份恢复命令
  • 2018-12-05Oracle 中文字段进行排序的sql语句
  • 2018-12-05MySQL数据库如何锁定和解锁数据库表?
  • 2018-12-05mysql的校对规则引起的问题分析
  • 2018-12-05CentOS6.4上使用yum安装mysql_MySQL
  • 2018-12-05sqlserver 触发器教程

文章分类

  • MsSql
  • Mysql
  • oracle
  • MariaDB
  • DB2
  • SQLite
  • PostgreSQL
  • MongoDB
  • Redis
  • Access
  • 数据库其它
  • sybase
  • HBase

最近更新的内容

    • MySQL中BETWEEN子句的用法实例详解
    • SQLSERVER 时间格式大全
    • mysql下为数据库设置交叉权限的方法实例详解
    • MySQL order by性能优化方法实例
    • RedHat5安装Mysql5.1.7
    • 使用MySQL产生随机数并且连接字符串的方法详解
    • 初步介绍MySQL中的集合操作
    • MySQL 多表查询实现分析
    • 什么是mysql c api? 解析mysql c api简单应用
    • MySQL导出所有Index和约束的方法

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有