Welcome 微信登录

首页 / 数据库 / MySQL / RedHat下MySQL 5.6 安装、维护

准备环境:RedHat 5系统、MySQL 5.6 rpm包首先 上传mysql至服务器1、 解压缩MySql[root@www.linuxidc.com]# tar -xvf MySQL-5.6.2_m5-1.rhel5.i386.tar MySQL-client-5.6.2_m5-1.rhel5.i386.rpmMySQL-devel-5.6.2_m5-1.rhel5.i386.rpmMySQL-embedded-5.6.2_m5-1.rhel5.i386.rpmMySQL-server-5.6.2_m5-1.rhel5.i386.rpmMySQL-shared-5.6.2_m5-1.rhel5.i386.rpmMySQL-test-5.6.2_m5-1.rhel5.i386.rpm2、 安装MySQL-server包[root@www.linuxidc.com]# rpm -ivh MySQL-server-5.6.2_m5-1.rhel5.i386.rpm error:Failed dependencies:     MySQL conflicts with mysql-5.0.45-7.el5.i386         MySQL-serverconflicts with mysql-server-5.0.45-7.el5.i386(安装失败,由于系统先前安装有mysql,把它卸载掉!再安装)        [root@www.linuxidc.com]# rpm -e mysql-5.0.45-7.el5.i386 --nodeps[root@www.linuxidc.com]# rpm -e mysql-server-5.0.45-7.el5.i386 –nodeps[root@www.linuxidc.com]# rpm -ivh MySQL-server-5.6.2_m5-1.rhel5.i386.rpm Preparing...        ########################################### [100%]   1:MySQL-server  ###########################################[100%][root@www.linuxidc.com]# rpm -ivh MySQL-client-5.6.2_m5-1.rhel5.i386.rpm Preparing...          ########################################### [100%]   1:MySQL-client    ########################################### [100%] 3、 启动mysql并设置登录密码[root@www.linuxidc.com]# /etc/init.d/mysql startStartingMySQL......[  OK  ][root@shiyue5 u01]# mysqladmin -u rootpassword "123456"4、 登录mysql并创建数据库[root@shiyue5~]# mysql -u root -pEnterpassword: Welcometo the MySQL monitor.  Commands end with; or g.YourMySQL connection id is 5Serverversion: 5.6.2-m5 MySQL Community Server (GPL) Copyright(c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. Oracleis a registered trademark of Oracle Corporation and/or itsaffiliates.Other names may be trademarks of their respectiveowners. Type"help;" or "h" for help. Type "c" to clear the current input statement. mysql>create database shiyue;QueryOK, 1 row affected (0.01 sec)5、 配置客户端连接mysql>use mysql;Readingtable information for completion of table and column namesYoucan turn off this feature to get a quicker startup with -A Database changedmysql>grant all on *.* to root@"%" identified by "123456";QueryOK, 0 rows affected (0.00 sec) 
通过对1042问题代码的查询,得出编辑/etc/my.cnf文件,在[mysqld]内添加一行skip-name-resolve在/etc/目录下如没有my.cnf配置文件,则请到/usr/share/mysql/下找到*.cnf文件,拷贝其中的一个到/etc/并改名为my.cnf[root@shiyue5~]# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf[root@shiyue5~]# vi /etc/my.cnf #Example MySQL config file for medium systems.## Thisis for a system with little memory (32M - 64M) where MySQL plays# animportant part, or systems up to 128M where MySQL is used together with#other programs (such as a web server)##MySQL programs look for option files in a set of#locations which depend on the deployment platform.# Youcan copy this option file to one of those#locations. For information about these locations, see:#http://dev.mysql.com/doc/mysql/en/option-files.html## Inthis file, you can use all long options that a program supports.# Ifyou want to know which options a program supports, run the program# withthe "--help" option. # Thefollowing options will be passed to all MySQL clients[client]#password       = your_passwordport            = 3306socket          = /var/lib/mysql/mysql.sock # Herefollows entries for some specific programs # TheMySQL server[mysqld]port            = 3306socket          = /var/lib/mysql/mysql.sockskip-external-lockingkey_buffer_size= 16Mmax_allowed_packet= 1Mtable_open_cache= 64sort_buffer_size= 512Knet_buffer_length= 8Kread_buffer_size= 256Kread_rnd_buffer_size= 512Kmyisam_sort_buffer_size= 8Mskip-name-resolve #Don"t listen on a TCP/IP port at all. This can be a security enhancement,# ifall processes that need to connect to mysqld run on the same host.# Allinteraction with mysqld must be made via Unix sockets or named pipes."/etc/my.cnf"145L, 4700C written
  • 1
  • 2
  • 下一页
手动创建Oracle 10g ASM磁盘组Navicat客户端连接MySQL数据库设置相关资讯      redhat  MySQL安装 
  • MySQL安装、配置、使用及JDBC链接  (02/23/2015 12:42:19)
  • 为什么像 RedHat 那样的开源旗手很  (12/23/2014 07:50:53)
  • CentOS 6.5 环境安装 MySQL 5.1  (09/22/2014 05:50:26)
  • Linux编译安装MySQL  (02/10/2015 19:49:03)
  • Linux下MySQL默认安装目录和常用命  (10/29/2014 19:07:55)
  • MySQL自动化运维之安装篇  (09/21/2014 10:00:17)
本文评论 查看全部评论 (0)
表情: 姓名: 字数