1.从
http://mysql.saudi.net.sa/Downloads/MySQL-5.1/MySQL-server-community-5.1.57-1.rhel5.i386.rpm
下载mysql server
下载mysql client
2.运行
rpm -ivh MySQL-server-community-5.1.57-1.rhel5.i386.rpm
[root@localhost temp]# rpm -ivh MySQL-server-community-5.1.57-1.rhel5.i386.rpm
Preparing... ########################################### [100%]
1:MySQL-server-community ########################################### [100%]
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 localhost.localdomain 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!
[root@localhost temp]#
3.启动mysql
service mysql start
4.安装mysql client
rpm -ivh MySQL-client-community-5.1.57-1.rhel5.i386.rpm
[root@localhost temp]# rpm -ivh MySQL-client-community-5.1.57-1.rhel5.i386.rpm
Preparing... ########################################### [100%]
1:MySQL-client-community ########################################### [100%]
[root@localhost temp]#
5.设置mysql密码
/usr/bin/mysql_secure_installation
提示输入原密码,默认是空,所以直接回车
为root用户设置密码,选择y并输入2次密码
删除匿名账号,选择y
是否禁止root用户远程登录,此项根据实际需要选择
是否删除test数据库,选择y
是否reload使设置立即生效,选择y
[root@localhost temp]# /usr/bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
[root@localhost temp]#
搞定
测试
mysql -u root -p
输入密码
显示
[root@localhost temp]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.1.57-community MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
测试成功
目录
数据库目录
/var/lib/mysql/
配置文件
/usr/share/mysql
相关命令(mysqldump等)
/usr/bin
启动脚本
/etc/rc.d/init.d/mysql
防火墙开3306端口
vi /etc/sysconfig/iptables
添加
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
分享到:
相关推荐
### Linux 下安装 MySQL 在 Linux 系统中安装 MySQL 数据库是一项常见的任务,尤其是在搭建 Web 服务器或开发环境中。本文将详细介绍如何在 Linux 系统上安装 MySQL,并提供相关的配置和管理指南。 #### 准备工作 ...
标题中的“Linux下安装Mysql”意味着我们将关注如何在Linux操作系统上安装MySQL数据库服务。这通常包括下载RPM包,验证依赖关系,然后进行安装。 描述中的“Linux mysql rpm安装包”指的是我们使用RPM包来安装MySQL...
Linux 下安装 MySQL 服务器 Linux 下安装 MySQL 服务器是指在 Linux 操作系统中安装和配置 MySQL 数据库服务器的过程。MySQL 是一种关系型数据库管理系统,广泛应用于 Web 应用程序中。 知识点: 1. 安装 MySQL ...
### Linux下安装MySQL 在Linux环境下安装MySQL是一个常见的任务,对于开发者、系统管理员以及数据库管理员而言至关重要。本文将详细介绍在Linux环境下安装MySQL的过程,并提供一些实用的技巧与建议。 #### 准备...
### Linux下安装MySQL详细步骤与知识点 #### 一、引言 在Linux环境下安装MySQL数据库是一项常见的任务,尤其是在CentOS这样的服务器操作系统上。本文将详细介绍如何在CentOS系统上安装MySQL,并解决安装过程中可能...
MySQL-server-community-5.1.60-1.rhel4.i386.rpm,linux下安装MySQL的安装包
### Linux下安装MySQL知识点详述 #### 一、下载与准备RPM包 在Linux环境下安装MySQL,首先需要获取MySQL的RPM包。RPM(Red Hat Package Manager)是一种用于管理软件包的工具,广泛应用于Red Hat Enterprise Linux...
Linux 下安装 MySQL Linux 是一个开源的操作系统, MySQL 是一个开源的关系数据库管理系统。在 Linux 系统中安装 MySQL 是一个非常重要的步骤。本文将一步步指导您如何在 Linux 系统中安装 MySQL。 查找以前是否...
【Linux下安装MySQL】 在Linux操作系统中安装MySQL数据库是一个必要的步骤,特别是在开发和管理Web应用程序时。本教程将详述如何在Linux环境下卸载旧版本的MySQL,以及如何正确安装和配置新版本的MySQL。 首先,...
### Linux下安装MySQL及基本操作 #### 一、安装MySQL 在Linux环境下安装MySQL数据库是一项常见但又重要的任务。本文将详细介绍如何在Linux系统中安装MySQL,并进行基本配置与操作。 ##### 1.1 检查系统是否已安装...
### Linux下安装MySQL数据库知识点详解 #### 一、前言 在Linux环境下安装MySQL数据库是一项常见但又较为复杂的任务,本文将详细介绍整个安装过程及注意事项,帮助读者顺利地完成安装。 #### 二、安装准备 1. **...
### 在Linux下安装MySQL的方法 #### 一、引言 随着Linux系统的广泛应用,越来越多的开发者开始选择在Linux环境下部署数据库应用。MySQL作为一款流行的关系型数据库管理系统,在Linux平台上的使用非常广泛。对于...
本文主要介绍了如何在 Linux 下安装 MySQL 5.0,包括下载安装文件、安装 MySQL 服务器和客户端 serta 使用 MySQL 的基本选项。 一、MySQL 的安装 在 Linux 下安装 MySQL 需要下载两个文件:MySQL-server-5.0.9-0....