虚拟机搭建CDH-第六讲-安装mysql第二种方法(通过rpm包安装)
来源:互联网 发布:公司seo是什么职位 编辑:程序博客网 时间:2024/06/01 08:29
1.上传安装文件到linux
MySQL-client-5.5.48-1.linux2.6.x86_64.rpm
MySQL-server-5.5.48-1.linux2.6.x86_64.rpm
2.使用rpm命令安装mysql
rpm -ivh MySQL-server-5.5.48-1.linux2.6.x86_64.rpm
3.mini版本linux安装mysql执行上面语句会报错,说明缺少依赖
4.安装perl依赖,libaio-0.3.107-10.el6.x86_64.rpm
5.安装依赖 rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm
6.再安装mysql-server,rpm包冲突
8.卸载冲突的rpm包
rpm -e mysql-libs-5.1.73-5.el6_6.x86_64 --nodeps
9.再安装mysql-server和mysql-client
10.启动mysql服务,然后初始化mysql
service mysql start
/usr/bin/mysql_secure_installation 进行初始化
11.初始化
NOTE: RUNNING ALL PARTS OF THIS SCRIPT ISRECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASEREAD 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, thepassword will be blank,
so you should just press enter here.
Enter current password for root (enter fornone):这里直接回车
OK, successfully used password, movingon...
Setting the root password ensures thatnobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:设置mysql root用户密码
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
...Success!
By default, a MySQL installation has ananonymous user, allowing anyone
to log into MySQL without having to have auser 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 toconnect from 'localhost'. This
ensures that someone cannot guess at theroot 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 productionenvironment.
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 ensurethat 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!
12.登录 mysql -uroot -proot
13.如果出现用户无法登录情况
状况如下
mysql -uroot -proot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
如出现此错误
按照下面操作
1.停止mysqld服务
service mysqld stop
2.以跳过授权的方式启动mysql
mysqld_safe --skip-grant-tables &
3.以root用户登录mysql
mysql -u root
4.进入mysql数据库
mysql> use mysql
5.更新mysql数据库中的user表的root的password字段
mysql> update user set password=PASSWORD("new_password") where User="root";
6.刷新权限,使其立即生效,之后退出mysql,并重新启动mysql
mysql> flush privileges;
mysql> quit
# service restart
- 虚拟机搭建CDH-第六讲-安装mysql第二种方法(通过rpm包安装)
- 虚拟机搭建CDH-第六讲-安装mysql第一种方法(比较简单)
- 虚拟机搭建CDH-第七讲-安装CM
- 虚拟机搭建CDH-第三讲-虚拟机安装linux1
- 虚拟机搭建CDH-第二讲-搭建CDH需要的环境
- 虚拟机搭建CDH-第四讲-安装第一台虚拟机需要修改的
- MySQL通过RPM安装
- MYSQL RPM包安装
- 【MySQL】RPM包安装
- rpm包安装方法
- hadoop通过RPM包安装
- 通过rpm包安装、配置及卸载mysql
- 通过rpm包安装、配置及卸载mysql
- 通过rpm包安装、配置及卸载mysql
- 通过rpm包安装、配置及卸载mysql
- 通过rpm包安装、配置及卸载mysql
- 通过rpm包安装、配置及卸载mysql
- Linux完全卸载通过rpm包安装的MySQL数据库
- C程序设计语言第二版1.20
- 南阳oj 题目 90 整数划分
- 字典操作
- xamarin学习笔记A01下(ios环境的安装)
- Protobuf3 系列三 更新Message类型
- 虚拟机搭建CDH-第六讲-安装mysql第二种方法(通过rpm包安装)
- SSH--Hibernate传值为乱码 || 显示为乱码
- 避免把情绪带进工作
- idea 新增lombok插件
- MyEclipse关联源码
- C程序设计语言第二版1.21
- Climbing Stairs
- ubuntu 16.04 virtualbox could not insert 'vboxdrv': Required key not available 问题解决方法
- 记录-Bootstrap编写个人网站主页