你好,游客 登录 注册 搜索
背景:
阅读新闻

ArchLinux之LMAP攻略

源码安装MySQL

[日期:2009-11-23] 来源:fantlam.blogbus.com  作者:fantlam [字体: ]

开始安装MySQL了。

先解压文件

[root@fantlam fantlam]# tar -xzvf mysql-5.1.40.tar.gz

[root@fantlam mysql-5.1.40]# vi INSTALL-SOURCE

看看安装指南,发现有这么一段

ArchLinux之LMAP攻略/图www.linuxidc.com

我们可以参考它来做。

添加组mysql和用户mysql并加入其中

[root@fantlam mysql-5.1.40]# groupadd mysql

[root@fantlam mysql-5.1.40]# useradd -g mysql mysql

[root@fantlam mysql-5.1.40]# vi /etc/group 发现组里多了mysql

ArchLinux之LMAP攻略/图www.linuxidc.com

[root@fantlam mysql-5.1.40]# passwd mysql

输入新的 UNIX 口令:

重新输入新的 UNIX 口令:

passwd:已成功更新密码

接下来是编译三部曲了,熟悉linux源码安装的朋友都会熟知,一般的操作步骤如下:

[root@fantlam mysql-5.1.40]# ./configure --prefix=/usr/local/mysql

[root@fantlam mysql-5.1.40]# make

这过程需要等上几分钟

[root@fantlam mysql-5.1.40]# make install

完成后在user/local/已经有mysql目录的出现,继续按教程走。

[root@fantlam mysql-5.1.40]# cp support-files/my-medium.cnf /etc/my.cnf

[root@fantlam mysql-5.1.40]# cd /usr/local/mysql

[root@fantlam mysql]# ls -l

总计 20

drwxr-xr-x 2 root root 4096 11-17 10:36 bin

drwxr-xr-x 2 root root 4096 11-17 10:36 docs

drwxr-xr-x 3 root root 4096 11-17 10:36 include

drwxr-xr-x 3 root root 4096 11-17 10:36 lib

drwxr-xr-x 3 root root 4096 11-17 10:36 share

[root@fantlam mysql]# chown -R mysql:mysql .

[root@fantlam mysql]# ls -l

总计 20

drwxr-xr-x 2 mysql mysql 4096 11-17 10:36 bin

drwxr-xr-x 2 mysql mysql 4096 11-17 10:36 docs

drwxr-xr-x 3 mysql mysql 4096 11-17 10:36 include

drwxr-xr-x 3 mysql mysql 4096 11-17 10:36 lib

drwxr-xr-x 3 mysql mysql 4096 11-17 10:36 share

可以看下前后的不同。

[root@fantlam mysql]# bin/mysql_install_db --user=mysql(初始化数据库)

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:

/usr/local/mysql/bin/mysqladmin -u root password 'new-password'

/usr/local/mysql/bin/mysqladmin -u root -h fantlam password 'new-password'

Alternatively you can run:

/usr/local/mysql/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 /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

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

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

Please report any problems with the /usr/local/mysql/bin/mysqlbug script!

The latest information about MySQL is available at http://www.mysql.com/

Support MySQL by buying support/licenses from http://shop.mysql.com/

顺利完成。

[root@fantlam mysql]# chown -R root .

[root@fantlam mysql]# chown -R mysql var

启动mysql

[root@fantlam mysql]# bin/mysqld_safe --user=mysql &(&表示抛到后台执行)

[1] 30793

[root@fantlam mysql]# 091117 12:17:55 mysqld_safe Logging to '/usr/local/mysql/var/fantlam.err'.

091117 12:17:55 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var

安装完成,可以试下连接验证一下。

ArchLinux之LMAP攻略/图www.linuxidc.com

linux
【内容导航】
第1页:Linux环境准备 第2页:源码安装MySQL
第3页:安装Apache和PHP 第4页:安装Discuz7.1
第5页:安装phpMyadmin
相关资讯       Archlinux  LMAP 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款