bugfree安装使用~~搞定!

Linux MySql安装

上一篇 / 下一篇  2009-10-10 16:34:12

Linux MySql安装
google_protectAndRun("render_ads.js::google_render_ad", google_handleError, google_render_ad);
进一段时间一直没有时间,疏于对论坛的管理,很是汗颜。从今天起尽量每天发(或转发)一两篇好文章上来。希望能对兄弟们有所帮助。


Mysql linux安装
来源: 作者: 出处:巧巧读书 2007-08-14 进入讨论组
关 键 词:dos  linux  mysql  mysql数据  word  

1.Add a login user and group for `mysqld' to run as:为‘mysqld’增添一个登陆用户和组
 shell> groupadd mysql
 shell> useradd -g mysql mysql

2.解压
 shell> gunzip < mysql-5.0.15.tar.gz | tar -xvf -
 shell> cd mysql-5.0.15

3.Configure the release and compile everything:配置和编译给configure分配可执行文件
 shell> chmod +x configure
改变字符集为 GBK [默认字符集为ISO-8859-1(Latin1)]
 shell> ./configure --prefix=/usr/local/mysql --with-charset=gbk
 shell> make
(字符集还有big5、cp1251、cp1257、czech、danish、dec8、dos、euc_kr、gb2312 gbk、german1、hebrew、 hp8、hungarian、koi8_ru、koi8_ukr、latin1、latin2、sjis、swe7、tis620、ujis、usa7、win1251或win1251ukr)

4.安装所有东西
 shell> make install

5.如果你想安装选项文件,使用当前存在的‘support-files’ 文件夹下的作为模板,例如:
 shell> cp support-files/my-medium.cnf /etc/my.cnf

6.如果想mysqld每次开机自动启动的话。cp -r support-files/mysql.server /etc/init.d/就行了
 shell> cp -r support-files/mysql.server /etc/init.d/mysql
 shell> cd /etc/rc.d/init.d
 shell> chmod +x mysql
 shell> /sbin/chkconfig --del mysql
 shell> /sbin/chkconfig --add mysql

7.进入安装目录
 shell> cd /usr/local/mysql

8.如果你以前没有安装过MySQL,你必须创建一个MySQL准许的表
 shell> bin/mysql_install_db --user=mysql

9.将程序的所有权限给‘root’ ,并且把数据目录的所有权给可以运行‘mysqld’的用户。假设MySQL的安装目录是(‘/usr/local/mysql’),命令如下所示:
把文件拥有权给‘root’
 shell> chown -R root  .
把数据目录拥护权给‘mysql’用户
 shell> chown -R mysql var
把组的权限给'mysql'组
 shell> chgrp -R mysql .

10.万事具备后,你就可以按照下面的命令测试并运行你的MySQL了:
 shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &
 shell> service mysql start

11.在一切正常后,要做的第一件事情是更改管理员的密码。你可以运行mysqladmin (请注意,此命令不一定在你的path中,所以最好是转到此命令的目录中直接执行):
 shell> cd bin
 shell> ./mysqladmin -u root password *********

12.运行其他用户访问本机:
 shell> ./mysql -u root -p mysql
 --------------------这里输入你刚才修改的管理员密码
 mysql> update user set host='' where host='localhost' and user='root';
 mysql> exit
 Bye

13.修改mysql数据库端口号
 shell> vi /etc/my.cnf
 --------------------修改里面的 port=**** 为你需要的端口号

14.重启应用
 shell> service mysql restart


TAG:

 

评分:0

我来说两句

日历

« 2024-04-26  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 85048
  • 日志数: 111
  • 图片数: 1
  • 建立时间: 2009-09-21
  • 更新时间: 2010-05-31

RSS订阅

Open Toolbar