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下安装mysqlLinux下安装mysqlLinux下安装mysqlLinux下安装mysql
Linux下安装Mysql数据库; Linux mysql rpm安装包 Linux mysql安装教程
linux 系统下安装mysql数据库
linux下安装mysql服务器
Linux下安装MYSQL简要方法,言简意赅,深入浅出
linux下安装MySQL,并开启MySQL远程访问功能
本TXT文件为第三章Linux 下安装 Mysql5.0 测试环境:系统 CentOS 5.2 MySQL版本 5.0.67 第一步:下载mysql-5.0.67.tar.gz 第二步:安装mysql-5.0.67 第三步:编译·安装 第四步:安装后的配置 ...
Linux 下 安装mysql, 当前使用的服务器是centos,mysql 。。。。。
帮助大家快速安装mysql,无盲点。 需要提前部署好服务器的操作系统centos 6.5,本文使用的是64位的操作系统 2,MySQL的安装包,需要提前下载好,mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz 3,MySQL的软件依赖包,...
最新Linux下安装mysql版本冲突问题解决.docx
Linux下安装MySQL5.7,内附安装文档,文档内容包含从安装到配置,以及开通远程访问。详细文档
linux下安装mysql5.5 自己整理的文档,一步一步很清晰明了,百分百安装成功
linux下安装mysql注意事项及部署程序须知
Linux下安装MySQL及基本操作
在Linux下安装Mysql(非root) 不用make等复杂的操作 自己安装过程的总结 绝对有效
Linux下安装MySQL