#查看本机mysql 安装路径

[hadoop@SY-0134 toolkit]$ rpm -qa|grep -i mysql

[hadoop@SY-0134 toolkit]$ whereis mysql

mysql: /usr/lib/mysql /usr/share/mysql

环境Centos, 经过检验,上述目录实际没有mysql的安装,只是有一些lib包和帮助语言包。

#解压mysql-5.5.39-linux2.6-i686.tar.gz 到/lab/mysql5.5目录

#配置mysql5.5 conf文件

cp support-files/my-medium.cnf /data/my.cnf

#修改my.cnf文件,配置Mysql数据存储目录

在mysqld下面添加:datadir=/lab/mysql5.5/data

#配置目录用户访问权限:

[hadoop@SY-0134 mysql5.5]$ scripts/mysql_install_db -user=hadoop

Installing MySQL system tables...

OK

Filling help tables...

OK

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

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

./bin/mysqladmin -u root password 'new-password'

./bin/mysqladmin -u root -h SY-0134 password 'new-password'

Alternatively you can run:

./bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

  

#设置mysqld服务随服务器启动

#切换到root用户

cp support-files/mysql.server /etc/rc.d/init.d/mysqld

chmod 700 /etc/init.d/mysqld

chkconfig --add mysqld

chkconfig -–level 2345 mysqld on

[root@SY-0134 mysql5.5]# chkconfig --list mysqld

mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off

#修改/etc/rc.d/init.d/mysqld文件设置,制定Mysql安装目录和数据存储目录

basedir=/lab/mysql5.5

datadir=/lab/mysql5.5/data

#启动mysqld服务

service mysqld start

#查看3306端口是否打开。要注意在防火墙中开放该端口

netstat -atln

权限放开 ,使得普通用户也能启动mysql服务

[root@SY-0134 mysql5.5]# chmod a+wrx /etc/init.d/mysqld

MySQL问题解决:-bash:mysql:command not found

解决办法,将mysql命令创建软连接到/usr/bin中:

ln -s /lab/mysql5.5/bin/mysql  /usr/bin

参考网址:

http://blog.csdn.net/tin591/article/details/12615255

Linux中MySQL5.5解压版普通用户安装的更多相关文章

  1. window安装mysql5.7解压版(解决乱码问题)

    ♣安装mysql两种方法 ♣下载mysql5.7解压版 ♣配置步骤 ♣解决服务无法启动 ♣解决乱码 1.安装mysql两种方法 MySQL安装文件分为两种,一种是msi格式的,一种是zip格式的.如果 ...

  2. Mysql系列(一)—— 基于5.7.22 解压版下载、安装、配置和卸载

    1.下载 从官网中直接获取自己想要的版本: MySQL Community Server 5.7.22 2.解压 将下载到的文件解压缩到自己喜欢的位置. 与mysql 5.6不同的是5.7版本中没有d ...

  3. MySQL5.6解压版服务无法启动—系统错误1067

    记录一下今天被坑了一下午的BUG 就从半个月前说起吧 当时....................................................................... ...

  4. mysql5.7解压版版安装步骤详情

    mysql有安装版和解压版之分: 安装版:以msi结尾的,这种版本优点是安装便捷,全是傻瓜式的下一步:缺点是会不自觉的安装一些我们根本不需要的组件. 解压版:以zip或者其他压缩格式结尾的,这种版本虽 ...

  5. linux中tar之解压和压缩常用

    我们知道在windows中解压和压缩有两个非常强大的工具winRar和国产的好压工具,在linux中也有一款强大的解压和压缩工具.那就是大名鼎鼎的tar.我们首先看看tar命令的使用格式 语法:tar ...

  6. Linux中下载、解压、安装文件

    一.将解压包发送到linux服务器上: 1.在windos上下载好压缩包文件后,通过winscp等SFTP客户端传送给linux 2.在linux中通过wget命令直接下载 #wget [选项] [下 ...

  7. window10 mysql5.7 解压版 安装

    1. 解压mysql-5.7.11-winx64.zip 到某文件夹, 如C:\DevelopCommon\mysql-5.7.11-winx64. 2. 配置环境变量 变量名 : MYSQL_HOM ...

  8. Linux中下载、解压、安装文件(转)

    原文地址:http://www.cnblogs.com/red-code/p/5539399.html 一.将解压包发送到linux服务器上: 1.在windos上下载好压缩包文件后,通过winscp ...

  9. linux中的文件解压命令

    http://apps.hi.baidu.com/share/detail/37384818 download ADT link http://dl.google.com/android/ADT-0. ...

随机推荐

  1. HDU5099——Comparison of Android versions(简单题)(2014上海邀请赛重现)

    Comparison of Android versionsProblem DescriptionAs an Android developer, itˇs really not easy to fi ...

  2. Linux Shell脚本入门:tee命令

    用途说明   在执行Linux命令时,我们可以把输出重定向到文件中,比如 ls >a.txt,这时我们就不能看到输出了,如果我们既想把输出保存到文件中,又想在屏幕上看到输出内容,就可以使用tee ...

  3. Android 自定义ActionBar

    Android 3.0及以上已经有了ActionBar的API,可以通过引入support package在3.0以下的平台引用这些API,但这儿呢,完全自定义一个ActionBar,不用引入额外ja ...

  4. long和Long的区别

    Java中数据类型分两种:1.基本类型:long,int,byte,float,double2.对象类型:Long,Integer,Byte,Float,Double其它一切java提供的,或者你自己 ...

  5. AXURE制作APP抽屉式菜单

    1.拖一个dynamic panel到窗体,将State1改名为State_首页: 2.拖2个dynamic panel到State_首页中,分别命名为侧边菜单及首页内容,首页内容盖住侧边菜单: 3. ...

  6. 伪分布模式下使用java接口,访问hdfs

    package com.bq.pro; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import ...

  7. Pod::Executable pull

    使用cocoapods 的时候遇到了以下错误:[!] Pod::Executable pull Updating eaf98af..ba3c030 error: Your local changes ...

  8. HDU 4864 (2014 Multi-University Training Contest 1 )

    考试时,想到了一个很类似的方法,但是总是差那么点,就是这么点,需要不断的努力啊!!! 题解: 基本思想是贪心. 对于价值c=500*xi+2*yi,yi最大影响100*2<500,所以就是求xi ...

  9. 函数fil_extend_space_to_desired_size

    /**********************************************************************//** Tries to extend a data f ...

  10. uva12230Crossing Rivers

    数学期望. 过每条河的时间的可能在[L/v,3*L/v]间均匀分布,数学期望为2*L/v. 然后在加上在陆上走的时间. #include<cstdio> #include<algor ...