Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已解决] 安装mysql到scripts/mysql_install_db --user=mysql

[复制链接]
little_bill 发表于 2009-8-17 16:32:19 | 显示全部楼层 |阅读模式
本帖最后由 little_bill 于 2009-8-19 11:54 编辑

安装MySQL


# tar xzvf MySQL-5.0.45-linux-i686-glibc23.tar.gz

# mv MySQL-5.0.45-linux-i686-glibc23 /usr/local/

# ln -s /usr/local/ MySQL-5.0.45-linux-i686-glibc23 /usr/local/MySQL

# useradd MySQL

# chown -R MySQL:root /usr/local/MySQL/

# cd /usr/local/MySQL


# ./scripts/MySQL_install_db --user=MySQL
----------------------------------
[root@localhost mysql]# ./scripts/MySQL_install_db --user=MySQL
bash: ./scripts/MySQL_install_db: 没有那个文件或目录
----------------------------------

     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
----------------------------------
[root@localhost mysql]# scripts/mysql_install_db --user=mysql
bash: scripts/mysql_install_db: 没有那个文件或目录
----------------------------------
两种方法都不行。
  7. If you have not installed MySQL before, you must create the MySQL
     data directory and initialize the grant tables:
          shell> scripts/mysql_install_db --user=mysql
网上没有找到解决的办法啊。。。。高手帮帮忙。。。郁闷我两天了。。。。
MySQL data directory and initialize 怎么创建?
PC机 RHEL5,没有安装过数据库。
 楼主| little_bill 发表于 2009-8-18 10:52:54 | 显示全部楼层
本帖最后由 little_bill 于 2009-8-18 11:03 编辑

没人知道怎么解决吗?

软件环境:

RHEL5
httpd-2.2.6.tar.bz2
MySQL-5.0.45-linux-i686-glibc23.tar.gz
php-5.2.4.tar.bz2
回复

使用道具 举报

 楼主| little_bill 发表于 2009-8-19 11:54:24 | 显示全部楼层
第一步:卸载mysql
    说明:mysql在linux的环境下有两种安装方式,一种是rpm方式,一种是二进制原文件方式
    在二进制源文件方式下,直接删除文件就可以,在rpm方式下使用如下方式卸载mysql。
1.    检验用户是否安装了使用rpm方式安装了mysql,命令为:rpm -qa | grep mysql
例如:mysql-4.1.10a-2.RHEL4.1
        
2.    如果用户安装了mysql,则全部卸载,在卸载的过程可能存在相互关联的包,需要强制卸载。加载关键字?nodeps
例如:rpm ?e mysql-4.1.10a-2.RHEL4.1 --nodeps

第二步:安装mysql
    方式一:二进制源文件安装
    0. 查询是否已经有 mysql 的账号:
[root@test root]# grep mysql /etc/passwd
# 如果没有 mysql 出现的话,那么请建立一个名为 mysql 的账号!
# 这个是要给 MySQL 的 Process 使用的!为了安全性,请务必建立!
# 如果之前已经建立过了,那么底下这一步建置的工作就可以跳过,
# 直接到 1. 解压缩与建立连结 去安装?!
 
[root@test root]# groupadd -g 315 mysql
# 因为我刚好没有 315 这个 GID ,而 mysql 是系统使用的账号,我希望他在 500 以内,
# 因此就选择 315 做为 mysql 的 gid ?!你当然可以变更这个数字,
# 使用小于 500 的 GID 做为系统的账号之用只是惯用的习惯而已啦! ^_^
 
[root@test root]# useradd -u 315 -g mysql -d /usr/local/mysql/data -M mysql
# 我使用 315 做为 mysql 这个账号(与群组同名!)的 UID 啦!
# 并且建立他的家目录在 /usr/local/mysql/data 里面!
 
1. 解压缩与建立连结:
[root@test root]# cd /usr/local    (因为已经是 binary 的套件,不用 make)
[root@test local]# tar -zxvf /root/mysql-max-5.0.27-linux-i686-icc-glibc23.tar.gz
...(讯息略过)....
# 最后会产生一个目录: mysql-max-5.0.27-linux-i686-icc-glibc23.tar.gz
 
2. [root@test local]# ln -s mysql-max-5.0.27-linux-i686-icc-glibc23.tar.gz mysql
# 通常习惯将 MySQL 安装在 /usr/local/mysql 当中!但为了未来升级版本的确认,
# 官方网站上面建议使用连结的方式来进行 MySQL 的使用!
 
3. 档案权限修正:
[root@test local]# mkdir -p /var/lib/mysql
[root@test local]# chown -R mysql:mysql /var/lib/mysql
[root@test local]# chown -R root:mysql /usr/local/mysql-5.0.27*
[root@test local]# chown -R mysql:mysql /usr/local/mysql/data
# 修改成较为安全,且数据库所属人为 mysql 喔!特别留意啦!
 
4. 建立数据库:
[root@test local]# cd mysql
[root@test mysql]# ./scripts/mysql_install_db
[root@test mysql]# chown -R mysql:mysql /var/lib/mysql
[root@test mysql]# chown -R mysql:mysql /usr/local/mysql/data
# 这个步骤会在 /usr/local/mysql/data 里面建立好 MySQL 的数据库!
# 由于 /usr/local/mysql/data 是 MySQL 的数据库目录,所以很重要喔!请多加备份!
# 不过,在新版的 3.23.57 这个版本当中,数据库竟然移到 /var/lib/mysql 去了!
# 还真是有点奇怪?!另外,根据诸多网友的回报,发现在建立数据库之后,
# 还需要重新设定一下数据库的所属群组与拥有者喔!
 
5. 启动测试:
[root@test mysql]# /usr/local/mysql/bin/safe_mysqld --user=mysql &
Starting mysqld daemon with databases from /usr/local/mysql/data
# 注意:这个时候 mysql 会建立一个 socket file 在 /var/lib/mysql/mysql.sock 喔!
# 未来我们在使用 MySQL 的各种指令功能时,都需要使用到这个 socket file,
# 但是 MySQL 偏偏预设的 socket file 是在 /tmp 底下,怎么办?!真讨厌,
# 我们可以透过这个简单的动作来欺骗我们的 MySQL 喔!
[root@test mysql]# ln -s /var/lib/mysql/mysql.sock  /tmp/
# 如果还是找不到 mysql.sock 时,请使用 find / -name mysql.sock  
# 来找出这个档案的绝对路径吧!
 
[root@test mysql]# netstat -tl | grep mysql
tcp        0      0 *:mysql                 *:*                     LISTEN
[root@test mysql]# ps -aux | grep mysql
mysql     6394  0.0  1.5 10528  992 pts/3    S    16:16   0:00 /usr/local/mysql/
mysql     6395  0.0  1.5 10528  992 pts/3    S    16:16   0:00 /usr/local/mysql/
mysql     6396  0.0  1.5 10528  992 pts/3    S    16:16   0:00 /usr/local/mysql/
root      6422  0.0  1.1  2408  732 pts/3    S    16:20   0:00 grep mysql
# 呵呵!这样就应该是搞定了! MySQL 已经在监听要求?!而且所有人为 mysql !
 
6. 开机后立即启动!
[root@test mysql]# vi /etc/rc.d/rc.local
# 将底下这一行加入这个档案的最后面一行喔!
cd /usr/local/mysql; /usr/local/mysql/bin/safe_mysqld --user=mysql &
# 这样一来,每次开机就可以自动的启动 MySQL ?!
# 注:由于很多网友回复之问题中发现,如果没有加上 cd /usr/local/mysql 时,
# 会导致无法自动于开机的时候启动,因此,请大家记得加上这个动作呢!
 
7. 进阶设定内容:
#  由于我们 MySQL 放置的地点在 /usr/local/mysql 内,这个目录并不在 PATH 当中!
#  且 man page 亦不在 MANPATH 里面,所以,我们要手动的帮他加入?!
 
[root@test mysql]# vi /etc/profile
# 大约在 33 行的地方,而且每个 distribution 设定的地方都不太相同!
# 请找到 export PATH ... 那一行,以 Mandrake 9.0 来说,大概在 33 行左右,
# 新加入一行:
PATH="$PATH":/usr/local/mysql/bin
export PATH ....(略)....
 
[root@test mysql]# vi /etc/man.config( 有的 distribution 为 /etc/man.conf )
# 可以在这个档案的任何地方加入底下这一行:
MANPATH /usr/local/mysql/man
# 就可以具有 man page 的能力了!
 
8. 建立 MySQL 的 root 账号密码!
[root@test mysql]# /usr/local/mysql/bin/mysqladmin -u root password 'your.password'
# 请建立密码!为了安全起见!否则你的 MySQL 数据库,将预设所有人都可以登入喔!
# 注意,如果执行上面的指令时,竟然出现如下的错误:
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
# 这表示 mysql 找不到 mysql.sock 这个档案!我们上面不是提到 mysql.sock 的
# 绝对路径吗?假设是 /var/lib/mysql/mysql.sock 好了,那么我们可以:
[root@test mysql]# /usr/local/mysql/bin/mysqladmin -u root \
>  -S /var/lib/mysql/mysql.sock password 'your.passwd'
# 当然也可以进行档案的连结阿! ln -s /var/lib/mysql/mysql.sock /tmp
 
[root@test mysql]# /usr/local/mysql/bin/mysql -u root -p  \
> [-S /var/lib/mysql/mysql.sock] # 后面 [] 的内容不一定需要!且 [] 不要打!
Enter password: <==这里输入你刚刚建立的那个密码喔!
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 3.23.57
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> exit
Bye

----------------------------------
问题已解决。找到方法。虽然没有回答,我也是要谢谢你们
回复

使用道具 举报

fghjh 发表于 2009-8-21 10:21:02 | 显示全部楼层
3The A-line wedding dress features a gloves factory shape that is fitted around the cheap wedding dresses bodice and flows out to the ground, resembling the outline of an uppercase A. The cheap wedding dress bridal dress flows fluidly from the bust to the hem with an unbroken line. Due to its classic and simple style, the A-line dress is appropriate for mother of bride dresses any occasion, from a quiet backyard gathering, to a traditional church ceremony.  Options: The A-line is wedding dresses a versatile shape since it bridesmaid dress can accommodate many different structural elements, wholesale wedding dress including horizontal seems that help wedding dresses define your waistline, or a separate bodice and skirt that feature contrasting fabrics. The look of the A-line dress is also dependant wedding dresses upon length, which can range from above the knee for wedding dress a fun and flirty bride, to a full-length dress bridal dresses that wedding dresses flows into a chapel-length train for the more traditional bride.  The princess cut is the most dramatic variation wholesale wedding dress of the A-line bridal glove gown. This style emphasizes the clean lines of the A-line by utilizing vertical panels that run from the neckline to the hem. The princess style provides elongating lines wedding dresses that create a slimming effect since your wedding Gowns eye focuses wedding dresses on the length created by these discount wedding dresses long, smooth seems.   Things to Consider: prom dress The A-line bridal dresses couture wedding dresses are flattering   on almost all body types. The long lines discount wedding dresses of the princess cut dress can create wedding dress the illusion of height on a shorter body,glove as well as slim down a rounded figure.   The full skirt wedding dresses of the A-line can also prom dresses hide a larger lower body, or create the illusion of curves on a narrow frame. Since the A-line dress is so versatile,   simple modifications wholesale wedding dress to the neckline, waistline, or fabric can glove accentuate your best features and hide wedding dresses those your not so fond of.  Dress Styles: A-Line/Princes wedding dresses You can also affect the look of bridal Gown the A-line bridal Gown wedding gown depending upon the added gloves embellishments you choose. Lace overlays or bead work can make a simple A-line weding dresses appear more formal,gloves factory while a touch of color provided by a ribbon or bow can make a stylish statement.  The A-line style can support many different fabric bridal gown choices, depending on the look you want.glove If you desire a simple look, free flowing silks like charmeuse gloves are the best option bridesmaid dresses because they allow the dress to hang naturally and create a soft bridesmaid dress feminine silhouette. If you want a more wedding dresses structured mittens appearance that emphasizes the continuity of discount wedding dresses the A-line style, you will want a bridal dresses heavier fabric that can maintain shape,bridal dress such as peau de soie silk or satin. This same effect can also be achieved with the women's gloves use of organza wedding dresses , or other supporting fabrics, that couture wedding dresses can be layered to create a full skirt.   
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-17 12:32 , Processed in 0.026136 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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