QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13540|回复: 18

[分享]MySQL for linux安装详解

[复制链接]
发表于 2005-1-8 15:36:15 | 显示全部楼层 |阅读模式
来源MySQL4.1.8的官方install文档
MySQL Installation Using a Source Distribution
安装源代码版本的MySQL

     shell> groupadd mysql
     shell> useradd -g mysql mysql
     shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
     shell> cd mysql-VERSION
     shell> ./configure --prefix=/usr/local/mysql
     shell> make
     shell> make install
     shell> cp support-files/my-medium.cnf /etc/my.cnf
     shell> cd /usr/local/mysql
     shell> bin/mysql_install_db --user=mysql
     shell> chown -R root  .
     shell> chown -R mysql var
     shell> chgrp -R mysql .
     shell> bin/mysqld_safe --user=mysql &

并作出解释:
Add a login user and group for `mysqld' to run as:为‘mysqld’增添一个登陆用户和组

          shell> groupadd mysql
          shell> useradd -g mysql mysql

Configure the release and compile everything:配置和编译

          shell> ./configure --prefix=/usr/local/mysql
--prefix后面指示了默认安装路径
          shell> make
如果还想知道更详细的configure命令,请查阅manual for configure

If you want to set up an option file, use one of those present in
     the `support-files' directory as a template. For example:如果你想安装选项文件,使用当前存在的‘support-files’ 文件夹下的作为模板,例如:

          shell> cp support-files/my-medium.cnf /etc/my.cnf

If you haven't installed MySQL before, you must create the MySQL
     grant tables:如果你以前没有安装过MySQL,你必须创建一个MySQL准许的表

          shell> bin/mysql_install_db --user=mysql

Change the ownership of program binaries to `root' and ownership
     of the data directory to the user that you will run `mysqld' as.
     Assuming that you are located in the installation directory
     (`/usr/local/mysql'), the commands look like this:将程序的所有权限给‘root’ ,并且把数据目录的所有权给可以运行‘mysqld’的用户。假设MySQL的安装目录是(‘/usr/local/mysql’),命令如下所示:

          shell> chown -R root  .
          shell> chown -R mysql var
          shell> chgrp -R mysql .

     The first command changes the owner attribute of the files to the `root' user. 第一行命令把文件拥有权给‘root’。The second changes the owner attribute of the data directory to the `mysql' user. 第二行把数据目录拥护权给‘mysql’用户。The third changes the group attribute to the `mysql' group.第三行把组的权限给'mysql'组。

After everything has been installed, you should initialize and test your distribution using this command:万事具备后,你就可以按照下面的命令测试并运行你的MySQL了:

     shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &
发表于 2005-1-8 18:57:34 | 显示全部楼层
啊,原来我还少了那么多步骤
回复

使用道具 举报

发表于 2005-1-10 13:14:29 | 显示全部楼层
Good!
回复

使用道具 举报

 楼主| 发表于 2005-1-11 09:28:44 | 显示全部楼层
女生版涩兔子
回复

使用道具 举报

发表于 2005-1-22 13:27:19 | 显示全部楼层
php难学啊
回复

使用道具 举报

发表于 2005-1-22 15:56:52 | 显示全部楼层
php跟C一样好学,比什么VB,BASIC好得多了。
有C基础的php一周就可以OK了
再学mysql
回复

使用道具 举报

 楼主| 发表于 2005-1-22 19:10:06 | 显示全部楼层
[quote:856bb06b9d="nomilk"]php难学啊[/quote]

想学好难
回复

使用道具 举报

发表于 2005-1-31 21:51:13 | 显示全部楼层
不错不错..
回复

使用道具 举报

发表于 2005-4-2 01:42:54 | 显示全部楼层
wo xia le yi ge mysql for linux,dan shi bu shi yuan dai ma ban ben de .wo gai zen me an zhuang a,hai you ,wo de  linux bu zhi dao zen me qu shu ru han zi .
回复

使用道具 举报

 楼主| 发表于 2005-4-2 08:17:48 | 显示全部楼层
安装中文语言包,具体方法可以到中文汉化版块儿察看

你下载的是RPM包,就直接安装好了
回复

使用道具 举报

发表于 2005-4-7 17:14:43 | 显示全部楼层
4.0.21都不需要configure和make了啊,直接解压缩,然后install_db就可以了啊,还是有的需要make而有的不需要啊?
回复

使用道具 举报

 楼主| 发表于 2005-4-7 18:25:31 | 显示全部楼层
看看Ourlinux杂志第3期兔兔写的文章http://zz.ourlinux.net/magazines/Red Hat Linux AS4安装MySQL数据库4.doc
回复

使用道具 举报

发表于 2005-5-6 21:43:31 | 显示全部楼层
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .

第一句,我这会报错,我这边必须先
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
然后
shell> bin/mysql_install_db --user=mysql
才能通过.

怎么回事?
回复

使用道具 举报

 楼主| 发表于 2005-5-7 11:07:19 | 显示全部楼层
可以去MySQL官方报道这个BUG
回复

使用道具 举报

发表于 2005-8-2 20:24:32 | 显示全部楼层
学习一下!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-20 07:01 , Processed in 0.068500 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表