mysql5.5语言包_Linux中MySQL5.5解压版普通用户安装

本文介绍如何在CentOS系统上安装并配置MySQL 5.5,包括解压安装包、配置my.cnf文件、设置服务启动、调整目录权限等步骤,并解决了mysql命令未找到的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#查看本机mysql 安装路径

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

[hadoop@SY-0134toolkit]$ 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

chmod700 /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

参考网址:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值