Red Hat 和Cent OS 低版本安装mysql
来源:互联网 发布:linux avi 转mp4 编辑:程序博客网 时间:2024/05/22 14:52
1、下载rpm安装文件
client:
[root@localhost mysql]wget http://dev.mysql.com/get/MySQL-client-5.6.13-1.el6.x86_64.rpm
server:
[root@localhost mysql]wget http://dev.mysql.com/get/MySQL-server-5.6.13-1.el6.x86_64.rpm
devel:
[root@localhost mysql]wget http://dev.mysql.com/get/MySQL-devel-5.6.13-1.el6.x86_64.rpm
2、 安装server、devel、client:
[root@localhost mysql]# rpm -ivh –replacefiles MySQL-server-5.6.13-1.el6.x86_64.rpm
Preparing… ########################################### [100%]
1:MySQL-server ########################################### [100%]
[root@localhost mysql]# rpm -ivh –replacefiles MySQL-client-5.6.13-1.el6.x86_64.rpm
Preparing… ########################################### [100%]
1:MySQL-client ########################################### [100%]
[root@localhost mysql]# rpm -ivh –replacefiles MySQL-devel-5.6.13-1.el6.x86_64.rpm
Preparing… ########################################### [100%]
1:MySQL-devel ########################################### [100%]
要移除安装可以使用 rpm -e MySQL-server 、 rpm -e MySQL-devel、MySQL-client即可;
3、 初始化数据库:
命令:/usr/bin/mysql_install_db
4、启动mysql服务:
命令:service mysql start
使用命令ps -ef | grep mysql 查看mysql进程:
[root@localhost mysql]# ps -ef | grep mysql
root 3992 1 0 01:15 pts/0 00:00:00 /bin/sh /usr/bin/mysqld_safe –datadir=/var/lib/mysql –pid-file=/var/lib/mysql/localhost.pid
mysql 4170 3992 2 01:15 pts/0 00:00:00 /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib/mysql –plugin-dir=/usr/lib64/mysql/plugin –user=mysql –log-error=/var/log/mysqld.log –pid-file=/var/lib/mysql/localhost.pid –socket=/var/lib/mysql/mysql.sock
root 4199 3338 0 01:15 pts/0 00:00:00 grep mysql
5、重置密码:
1)更改/etc/my.cnf文件
[root@localhost mysql]# vi /etc/my.cnf
在[mysqld]下添加skip-grant-tables,保存退出。
2)重启mysql
[root@localhost mysql]service mysql restart
3)登录:
[root@localhost mysql]mysql -u root -p
Enter password:
这里直接按回车登录。
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.13 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.
4)选择数据库:
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
5)设置密码:
mysql> update user set password=(‘123456’) where user = ‘root’;
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
6)重新加载配置文件
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
7)退出
mysql> quit
Bye
8)更改/etc/my.cnf文件
[root@localhost mysql]# vi /etc/my.cnf
在[mysqld]下删除skip-grant-tables,保存退出
9)2)重启mysql
[root@localhost mysql]service mysql restart
好了,现在连接数据库访问了!
- Red Hat 和Cent OS 低版本安装mysql
- red hat 5(cent os)裸机安装mysql,unixODBC
- Red Hat (Cent OS)安装tmux工具
- Red Hat Enterprise Linux 与Cent OS以及VMware虚拟机
- red hat 安装mysql
- Red Hat 安装MySQL
- Cent OS查看Apache,Mysql和PHP版本信息
- Red Hat 9安装MySQL
- 在运行 Red Hat 或 Cent OS 的虚拟机中扩展逻辑卷 (2075720)
- cent os 安装MYSQL 5.5 源码包
- Linux Cent OS下安装MySQL数据库
- CentOS 和 red hat 版本对应
- Red Hat 下 安装 Apache Mysql PHP
- Red Hat Linux下面安装MySQL数据库
- red hat linux下安装mysql
- Red Hat安装MySQL之旅
- Red Hat安装单机版mysql数据
- Red Hat 6 安装 MySQL 5.7.18
- iOS开发:创建真机调试证书
- cognos Mashup 与 ECharts
- Android多用户系列:跨用户启动(绑定)Service、启动Activity、访问ContentProvider
- 用户定位
- Object-C--->Swift之(五)数组和字典
- Red Hat 和Cent OS 低版本安装mysql
- fragment
- 开源日志系统比较:scribe、chukwa、kafka、flume
- EJB invocations from a remote client using JNDI
- 使用DES方式,加、解密字符
- JSQMessagesViewController (一)
- linux系统shell语法简介-49
- C++语言学习资料大全分享 想要的速度下
- Nine-Patch格式图片浅析