linux下安装mysql5.5.43



find / -name mysql   查找文件

1,.d  删除vi编辑器中内容

1. 查看之前是否安装过mysql  :  rpm -qa|grep -i mysql
2、停止mysql服务、删除之前安装的mysql
   删除命令:rpm -ev –nodeps 包名
2.查找是否包含mysql文件夹,有的话删除  :    find / -name mysql
3.卸载后/etc/my.cnf不会删除,需要进行手工删除
4、再次查找机器是否安装mysql: rpm -qa|grep -i mysql
5.确认未安装后, wget 命令下载mysql安装包 : (http://dev.mysql.com/downloads/mysql/5.5.html  )
  RPM Package  Client Utilities:         MySQL-client-5.5.43-1.linux2.6.x86_64.rpm
    http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.43-1.linux2.6.x86_64.rpm
  RPM Package  MySQL Server:             MySQL-server-5.5.43-1.linux2.6.x86_64.rpm
    http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.43-1.linux2.6.x86_64.rpm
  RPM Package Development Libraries:     MySQL-devel-5.5.43-1.linux2.6.x86_64.rpm
    http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-5.5.43-1.linux2.6.x86_64.rpm
6.安装server
rpm  MySQL-server-5.5.43-1.linux2.6.x86_64.rpm
rpm  MySQL-client-5.5.43-1.linux2.6.x86_64.rpm
rpm  MySQL-devel-5.5.43-1.linux2.6.x86_64.rpm

7. 设置文件夹下目录权限:   /var/lib/mysql   chmod 777 -R *    (文件夹下有mysql-bin.index这个文件)
8. cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
9.设置编码,编辑my.cnf 文件,在[mysqld]下添加以下五行:

character_set_server=utf8
character_set_client=utf8
collation-server=utf8_general_ci
lower_case_table_names=1
max_connections=1000

10.启动mysql:  service mysql start
12. 修改密码(初始管理员root没有密码):umimamysqladmin -uroot password 123456  或 mysql -u root password  '123456'
或者 :mysql -uroot 进入数据库,然后 SET PASSWORD = PASSWORD('123456');
13.进入数据库查看编码:
mysql> show variables like 'character_set_%';
14.设置开机启动:chkconfig mysql on
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA CMAKE_MINIMUM_REQUIRED(VERSION 2.6) # Avoid warnings in higher versions if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6) CMAKE_POLICY(VERSION 2.8) endif() # We use PROPERTIES LINK_INTERFACE_LIBRARIES. See cmake --help-policy CMP0022 IF(CMAKE_VERSION VERSION_EQUAL "2.8.12" OR CMAKE_VERSION VERSION_GREATER "2.8.12") CMAKE_POLICY(SET CMP0022 OLD) ENDIF() # We use the LOCATION target property (CMP0026) # and get_target_property() for non-existent targets (CMP0045) # and INSTALL_NAME_DIR (CMP0042) IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR CMAKE_VERSION VERSION_GREATER "3.0.0") CMAKE_POLICY(SET CMP0026 OLD) CMAKE_POLICY(SET CMP0045 OLD) CMAKE_POLICY(SET CMP0042 OLD) ENDIF() MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") # Will set GIT_EXECUTABLE and GIT_FOUND FIND_PACKAGE(Git) SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # First, decide about build type (debug or release) # If custom compiler flags are set or cmake is invoked with -DCMAKE_BUILD_TYPE, # respect user wishes and do not (re)define CMAKE_BUILD_TYPE. If WITH_DEBUG{_FULL} # is given, set CMAKE_BUILD_TYPE = Debug. Otherwise, use Relwithdebinfo. IF(DEFINED CMAKE_BUILD_TYPE) SET(HAVE_CMAKE_BUILD_TYPE TRUE) ENDIF() SET(CUSTOM_C_FLAGS $ENV{CFLAGS}) OPTION(WITH_DEBUG "Use dbug/safemutex" OFF) # Distinguish between community and non-community builds, with the # default being a community build. This does not impact the feature # set that will be compiled in; it's merely provided as a hint to # custom packaging steps. OPTION(COMMUNITY_BUILD "Set to true if this is a community build" ON) # Use a default manufacturer if no manufacturer was identified. SET(MANUFACTURER_DOCSTRING "Set the entity that appears as the manufacturer of packages that support a manufacturer field.") IF(NOT DEFINED MANUFACTURER) SET(MANUFACTURER "Built from Source" CACHE STRING ${MANUFACTURER_DOCSTRING}) MARK_AS_ADVANCED(MANUFACTURER) ENDIF() # We choose to provide WITH_DEBUG as alias to standard CMAKE_BUILD_TYPE=Debug # which turns out to be not trivial, as this involves synchronization # between CMAKE_BUILD_TYPE and WITH_DEBUG. Besides, we have to deal with cases # where WITH_DEBUG is reset from ON to OFF and here we need to reset # CMAKE_BUILD_TYPE to either none or default RelWithDebInfo SET(BUILDTYPE_DOCSTRING "Choos

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值