快速业务通道

linux上安装MySQL

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-03-25
ke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2011296 inodes, 4018250 blocks
200912 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4118806528
123 block groups
32768 blocks per group, 32768 fragments per group
16352 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@beryl ~]# mkdir mydata //在根目录下创建mydata目录
[root@beryl ~]# mount /dev/sdb5 mydata/ //挂载sdb5到mydata目录上
[root@beryl ~]# ls mydata/ //查看挂载是否成功,lost found表明挂载成功
lost found
[root@beryl ~]# useradd -r -M mysql //添加mysql用户,-r表示为系统用户


[root@beryl ~]# id mysql //查看mysql属主属组
uid=27(mysql) gid=27(mysql) groups=27(mysql)
[root@beryl ~]# cd mydata/
[root@beryl mydata]# mkdir data //在mydata下创建data目录用于专门来安装mysql
[root@beryl mydata]# chown -R mysql:mysql .

//指定mydata属主属组及其子目录属主属组为mysql

[root@beryl mydata]# ll
total 20
drwxr-xr-x 2 mysql mysql 4096 Nov 3 21:45 data
drwx------ 2 mysql mysql 16384 Nov 3 21:43 lost found
[root@beryl ~]# cd
[root@beryl ~]# tar -zxvf Desktop/mysql-5.5.17-linux2.6-i686.tar.gz -C /usr/local/

//解压mysql并使用-C指定直接解压到/usr/local
[root@beryl ~]# cd /usr/local
[root@beryl local]# ls
bin games lib mysql-5.5.17-linux2.6-i686 share
etc include libexec sbin src
[root@beryl local]# ln -sv mysql-5.5.17-linux2.6-i686/ mysql

//把解压的mysql创建链接到mysql
create symbolic link `mysql'' to `mysql-5.5.17-linux2.6-i686/''
[root@beryl local]# ll -h
total 76K
drwxr-xr-x 2 root root 4.0K Aug 8 2008 bin
drwxr-xr-x 2 root root 4.0K Aug 8 2008 etc
drwxr-xr-x 2 root root 4.0K Aug 8 2008 games
drwxr-xr-x 2 root root 4.0K Aug 8 2008 include
drwxr-xr-x 2 root root 4.0K Aug 8 2008 lib
drwxr-xr-x 2 root root 4.0K Aug 8 2008 libexec
lrwxrwxrwx 1 root root 27 Nov 3 21:48 mysql -> mysql-5.5.17-linux2.6-i686/
drwxr-xr-x 13 root root 4.0K Nov 3 21:46 mysql-5.5.17-linux2.6-i686
drwxr-xr-x 2 root root 4.0K Aug 8 2008 sbin
drwxr-xr-x 4 root root 4.0K Apr 12 2011 share
drwxr-xr-x 2 root root 4.0K Aug 8 2008 src
[root@beryl local]# cd mysql
[root@beryl mysql]# ll
total 76
drwxr-xr-x 2 root root 4096 Nov 3 21:46 bin
-rw-r--r-- 1 7161 wheel 17987 Oct 12 04:10 COPYING
drwxr-xr-x 4 root root 4096 Nov 3 21:46 data
drwxr-xr-x 2 root root 4096 Nov 3 21:46 docs
drwxr-xr-x 3 root root 4096 Nov 3 21:46 include
-rw-r--r-- 1 7161 wheel 7604 Oct 12 04:10 INSTALL-BINA

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号