免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1234 | 回复: 0
打印 上一主题 下一主题

CentOS 4.6 安装mysql-max [复制链接]

论坛徽章:
1
15-16赛季CBA联赛之北控
日期:2022-03-04 22:35:50
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-06 10:58 |只看该作者 |倒序浏览

作者: gfhlole  出自: http://www.linuxdiyf.com
说明:本人在参考网上的资料的基础上,自己钻研后安装,现在在公司运行的非常ok。
一,安装好centos,安装时我把所有的开发工具包都选中,给装上了。
二、获得mysql-max-5.0.27-linux-i686-glibc23.tar.gz ,这个请大家从网上自己下,找不到的,请E-mail通知我, 我发给需要者。
三、进入正题,安装了。首先解压,我一般放在/usr/local/ 目录下
# cp mysql-max-5.0.27-linux-i686-glibc23.tar.gz /usr/local/
#tar xxzvf mysql-max-5.0.27-linux-i686-glibc23.tar.gz
# mv mysql-max-5.0.27-linux-i686-glibc23 mysql
四、建立mysql配置文件
# cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf //在support-files目录下有4个模版文件,我们选择其中一个作为Mysql的配置文件。my.cnf (其中设置 了性能参数和Mysql的一些路径参数)
五、建立mysql用户和mysql组
#groupadd msyql
#useradd -g mysql mysql
六、初始化mysql
#/usr/local/mysql/scripts/mysql_install_db --user=mysql
出现如下提示表示,初始化mysql正确。
Installing all prepared tables
Fill help tables
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 localhost.localdomain password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the ./bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at
http://shop.mysql.com
出现如下报错,我没有处理这个问题,仍就继续安装,有时mysql仍可正常运行,这个报错有待解决,请大家都来讨论讨论。
/usr/local/mysql/scripts/mysql_install_db: line 85: my_print_defaults: command not found
Could not find help file 'fill_help_tables.sql' in ./support-files or inside ..
在这之后,我又研究了一下,严格按照上面的步骤,都没有报错了。
七、更改目录权限 (当前目录为 /usr/local/mysql )
# chown -R root .
#chgrp -R mysql .
#chown -R mysql data
八、启动mysql
# /usr/local/mysql/bin/mysqld_safe --user=mysql &
//运行mysql,如果没有问题的话,应该会出现类似这样的提示# Starting mysqld daemon with databases from /usr/local/mysql/var 如果出现 mysql ended这样的语句,表示Mysql没有正常启动,你可以到log中查找问题,Log文件的通常在/etc/my.cnf中配 置。大多数问题是权限设置不正确引起的。
九、设置mysql的管理密码
# /usr/local/mysql/bin/mysqladmin -u root password 'yourpassword'
//默认安装密码为空,为了安全你必须马上修改.
十、修改字符集
修改默认字符集--: database_character_server=utf8
配置/etc/my.cnf,在 [client] 和 [mysqld] 节中加入:
default-character-set = gbk
(或者default-character-set = utf8)
十一、是mysql随OS启动而启动
# cp support-files/mysql.server /etc/rc.d/init.d/mysqld
# chmod 700 /etc/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 345 mysqld on
十二、启动mysql
# service mysqld start
# netstat -atln //查看3306端口是否打开。要注意在防火墙中开放该端口。
十三、client测试
从centos DVD盘中找到这两个mysql在linux下的client端包,并安装。
#rpm -ivh mysqlclient10-3.23.58-4.RHEL4.1.i386.rpm
#rpm -ivh mysqlclient10-devel-3.23.58-4.RHEL4.1.i386.rpm
#vi /root/bash_profile
把其中的
PATH=$PATH:$HOME
改为
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
再重新开一个终端
#mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 5.0.27-max
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
安装完毕。

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/31/showart_518597.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP