CentOS 6.6 MySQL 5.5.32 绿色版安装配置

前端之家收集整理的这篇文章主要介绍了CentOS 6.6 MySQL 5.5.32 绿色版安装配置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

MysqL 5.5.32 绿色版安装配置

  1. @H_403_13@基本信息

@H_403_13@系统版本:CentOS 6.6

MysqL@H_403_13@版本:5.5.32 @H_403_13@绿色版

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

[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. @H_403_13@改变/application/MysqL@H_403_13@所属主和组,cp@H_403_13@配置文件,改变MysqL@H_403_13@启动脚本里的路径

[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###@H_403_13@修改脚本里的安装路径

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

  1. @H_403_13@查看MysqL@H_403_13@是否正常启动

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

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

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

  1. @H_403_13@配置环境变量

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

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

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

/application/MysqL/bin/MysqL

  1. @H_403_13@登陆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. @H_403_13@配置传统方式启动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 ##@H_403_13@修改MysqL@H_403_13@安装路径

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

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

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

  1. @H_403_13@设置MysqL@H_403_13@管理员密码,默认管理员是root@H_403_13@用户

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

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

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

  1. @H_403_13@查看错误日志

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

猜你在找的CentOS相关文章