红联Linux门户
Linux帮助

各位大侠,请问red flag linux系统下如何暗转mysql呀!

发布时间:2009-12-16 15:50:11来源:红联作者:heavyliushg
位大侠,请问red flag linux系统下如何暗转mysql呀!
文章评论

共有 3 条评论

  1. angelsinklow 于 2009-12-29 00:34:59发表:

    shell> groupadd mysql
    shell> useradd -g mysql mysql
    shell> cd /usr/local
    shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
    shell> ln -s full-path-to-mysql-VERSION-OS mysql
    shell> cd mysql
    shell> chown -R mysql .
    shell> chgrp -R mysql .
    shell> scripts/mysql_install_db --user=mysql
    shell> chown -R root .
    shell> chown -R mysql data
    shell> bin/mysqld_safe --user=mysql &



    shell> groupadd mysql
    shell> useradd -g mysql mysql
    shell> ./configure --prefix=/usr/local/mysql --with-charset=utf8
    shell> make
    shell> make install
    shell> scripts/mysql_install_db
    shell> chown -R root /usr/local/mysql
    shell> chown -R mysql /usr/local/mysql/var
    shell> chgrp -R mysql /usr/local/mysql
    shell> cp support-files/my-medium.cnf /etc/my.cnf
    shell> /usr/local/mysql/bin/safe_mysqld --user=mysql &

    /usr/local/mysql/bin/mysqladmin -u root password newpassword 改密
    grant all privileges on *.* to root@"%" identified by 'password' with grant option; 增加一个可以从任何地方连接服务器的一个完全的超级用户
    grant select,insert,update,delete on *.* to user1@"%" Identified by "abc"; 可以在任何主机上登录,并对所有数据库有查询、插入、修改、删除的权限

    脚本mysql.server(位于`share/mysql'目录中)用于启动或停止MySQL服务器:
    shell> mysql.server start
    shell> mysql.server stop
    该脚本实际上通过执行safe_mysqld启动服务器。停止服务器也可以通过管理程序实现:
    mysqladmin shutdown
    也可通过将下述命令加入`/etc/rc.local'文件,在系统启动时自动启动MySQL:
    /bin/sh -c 'cd /usr/local/mysql ; ./bin/safe_mysqld &'

  2. hantu 于 2009-12-17 11:22:18发表:

    "暗转"应该是"安装"吧

    从光盘里安装 rpm -ivh *mysql*rpm 就行了

  3. Action 于 2009-12-16 16:09:15发表:

    参考http://www.linuxdiyf.com/bbs/thread-114498-1-1.html