CentOS 6.6 MySQL 5.5.32 绿色版安装配置

MysqL 5.5.32 绿色版安装配置

  1. 基本信息

系统版本:CentOS 6.6

MysqL版本:5.5.32 绿色版

  1. 初始化MysqL,出现黄色部分两个OK,表示初始化正确

[root@lnmp02 tools]# useradd -s/sbin/nologin -M MysqL

[root@lnmp02 tools]# tar zxvfMysqL-5.5.32-linux2.6-x86_64.tar.gz

[root@lnmp02 tools]# mvMysqL-5.5.32-linux2.6-x86_64 /application/MysqL-5.5.32

[root@lnmp02 tools]# ln -s/application/MysqL-5.5.32 /application/MysqL

[root@lnmp02 application]#/application/MysqL/scripts/MysqL_install_db --basedir=/application/MysqL/--datadir=/application/MysqL/data/ --user=MysqL

Installing MysqL system tables...

OK

Filling help tables...

OK

To start MysqLd at boot timeyou have to copy

support-files/MysqL.server tothe right place for your system

PLEASE REMEMBER TO SET APASSWORD FOR THE MysqL root USER !

To do so,start the server,then issue the following commands:

/application/MysqL//bin/MysqLadmin-u root password 'new-password'

/application/MysqL//bin/MysqLadmin-u root -h lnmp02 password 'new-password'

Alternatively you can run:

/application/MysqL//bin/MysqL_secure_installation

which will also give you theoption of removing the test

databases and anonymous usercreated by default. This is

strongly recommended forproduction servers.

See the manual for moreinstructions.

You can start the MysqL daemonwith:

cd /application/MysqL/ ;/application/MysqL//bin/MysqLd_safe &

You can test the MysqL daemonwith MysqL-test-run.pl

cd/application/MysqL//MysqL-test ; perl MysqL-test-run.pl

Please report any problems withthe /application/MysqL//scripts/MysqLbug script!

  1. 改变/application/MysqL所属主和组,cp配置文件,改变MysqL启动脚本里的路径

[root@lnmp02 ~]# chown -RMysqL.MysqL /application/MysqL/

[root@lnmp02 ~]# cp /application/MysqL/support-files/my-small.cnf/etc/my.cnf

[root@lnmp02 ~]# sed -i's#/usr/local/MysqL#/application/MysqL#g'/application/MysqL/bin/MysqLd_safe###修改脚本里的安装路径

[root@lnmp02 ~]#/application/MysqL/bin/MysqLd_safe &###后台进程方式启动MysqL

  1. 查看MysqL是否正常启动

[root@lnmp02 ~]# lsof -i:3306

[root@lnmp02 ~]# netstat-tulpn|grep 3306

[root@lnmp02 ~]# ps -ef|grepMysqL

  1. 配置环境变量

[root@lnmp02 ~]# echo"PATH=/application/MysqL/bin:$PATH" >>/etc/profile

[root@lnmp02 ~]# source/etc/profile

[root@lnmp02 ~]# which MysqL ###确定是否是绿色版的MysqL而不是yum安装的MysqL

/application/MysqL/bin/MysqL

  1. 登陆MysqL

[root@lnmp02 ~]# MysqL

Welcome to the MysqLmonitor. Commands end with ; or \g.

Your MysqL connection id is 3

Server version: 5.5.32 MysqLCommunity Server (GPL)

copyright (c) 2000,2013,Oracle and/or its affiliates. All rights reserved.

Oracle is a registeredTrademark of Oracle Corporation and/or its

affiliates. Other names may beTrademarks of their respective

owners.

Type 'help;' or '\h' for help.Type '\c' to clear the current input statement.

MysqL>

  1. 配置传统方式启动MysqL

[root@lnmp02 ~]# cp/application/MysqL/support-files/MysqL.server /etc/init.d/MysqLd

[root@lnmp02 ~]# sed -i's#/usr/local/MysqL#/application/MysqL#g' /etc/init.d/MysqLd ##修改MysqL安装路径

[root@lnmp02 ~]# killall MysqLd ###杀死之前启动的MysqL进程

[root@lnmp02 ~]# lsof -i:3306 ###确认是否已杀死MysqL进程

[root@lnmp02 ~]#/etc/init.d/MysqLd start ###以传统方式重新启动MysqL进程

  1. 设置MysqL管理员密码,管理员root用户

[root@lnmp02 ~]# MysqLadmin-uroot password "123456"

[root@lnmp02 ~]# MysqL -uroot-p123456 ###登陆MysqL,注意,-p和密码之间不能有空格

[root@lnmp02 ~]# MysqLadmin-uroot -p123456 password "wangning"###更改密码

  1. 查看错误日志

[root@lnmp02 ~]# cat /application/MysqL/data/lnmp02.err ###错误日志文件是以主机名加.err后缀命名的

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native
centos6.5下postgres-XC集群安装与配置
CentOS 6使用openssl搭建根CA
CentOS6.6中安装VNC server
CentOS下更新Python最新版本
Centos安装pycurl
CentOS 7 安装PostGIS
CentOS 7.1PXE网络自动化安装
CentOS下ffmpeg与第三方编码编译安装
CentOS 6.4安装配置squid
CentOS6.5 安装配置drbd
CentOS6.4 安装jenkins
centos安装增强工具
CentOS6.4安装配置redis
CentOS 6上部署OpenVPN Server