Welcome 微信登录

首页 / 数据库 / MySQL / RedHat 6.3安装MySQL-server-5.6.13-1.el6.x86_64.rpm

在RedHat 6.3下安装MySQL-server-5.6.13-1.el6.x86_64.rpm首先下载下面三个文件:MySQL-client-5.6.13-1.el6.x86_64.rpm
MySQL-devel-5.6.13-1.el6.x86_64.rpm
MySQL-server-5.6.13-1.el6.x86_64.rpm然后使用root账号登陆,进行安装:1. 安装server、devel、client:1. 安装server、devel、client:rpm -ivh --replacefiles MySQL-s*.rpmrpm -ivh --replacefiles MySQL-d*.rpmrpm -ivh --replacefiles MySQL-c*.rpm[root@localhost download]# rpm -ivh --replacefiles MySQL-server-5.6.13-1.el6.x86_64.rpm 
Preparing...                ########################################### [100%] 
 1:MySQL-server         ########################################### [100%] 
[root@localhost download]# rpm -ivh --replacefiles MySQL-client-5.6.13-1.el6.x86_64.rpm 
Preparing...                ########################################### [100%] 
 1:MySQL-client         ########################################### [100%] 
[root@localhost download]# 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即可;2. 初始化数据库:/usr/bin/mysql_install_db3. 启动mysql服务:service mysql start使用命令ps -ef | grep mysql 查看mysql进程:[root@localhost ~]# ps -ef | grep mysql 
root   26047   1  0 18:14 pts/12 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid 
mysql    26227 26047  0 18:14 pts/12 00:00:01 /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.localdomain.pid --socket=/var/lib/mysql/mysql.sock 
root   26545 24726  0 18:27 pts/8    00:00:00 grep mysql4.第一次登陆设置root密码:首先查看 cat /root/.mysql_secretroot@localhost ~]# cat /root/.mysql_secret 
# The random password set for the root user at Fri Aug 30 15:57:18 2013 (local time): fMYcarvB然后命令行:mysql -u root -p ,然后输入上面的密码即可:[root@localhost ~]# mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or g. 
Your MySQL connection id is 5 
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.设置root密码:mysql> use mysql 
Database changed 
mysql> update user set password=password("root") where user="root"; 
Query OK, 0 rows affected (0.15 sec) 
Rows matched: 5  Changed: 0  Warnings: 0 
 
mysql> flush privileges; 
Query OK, 0 rows affected (0.00 sec)退出,重新登陆即可使用新的密码登陆;5. 设置远程登陆:使用root登陆到mysql后mysql> update user set host="%" where user="root"; 
ERROR 1062 (23000): Duplicate entry "%-root" for key "PRIMARY" 
mysql> select host,user from user; 
+-----------------------+------+ 
| host                  | user | 
+-----------------------+------+ 
| %                   | root | 
| 127.0.0.1           | root | 
| 192.168.128.142     | root | 
| ::1                 | root | 
| localhost.localdomain | root | 
+-----------------------+------+ 
5 rows in set (0.00 sec)然后:mysql> grant all privileges on *.* to "root"@"%" with grant option; 
Query OK, 0 rows affected (0.08 sec) 
 
mysql> exit 
Bye 
[root@localhost ~]# service mysql restart 
Shutting down MySQL.. SUCCESS! 
Starting MySQL.. SUCCESS! 
重启mysql即可远程登陆。更多RedHat相关信息见RedHat 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=10Oracle数据库备份导出时,报错:ORA-12514基于RMAN实现坏块介质恢复(blockrecover)相关资讯      MySQL安装  MySQL 5.6.13 安装 
  • MySQL安装、配置、使用及JDBC链接  (02/23/2015 12:42:19)
  • Linux下MySQL默认安装目录和常用命  (10/29/2014 19:07:55)
  • MySQL自动化运维之安装篇  (09/21/2014 10:00:17)
  • Linux编译安装MySQL  (02/10/2015 19:49:03)
  • CentOS 6.5 环境安装 MySQL 5.1  (09/22/2014 05:50:26)
  • CentOS 6.4安装MySQL的过程中出现  (08/05/2014 06:40:47)
本文评论 查看全部评论 (0)
表情: 姓名: 字数