记得在fedora7中按照mysql的安装文档一步步来就行,可在fedora8中却出现了问题,经多方查找原因终于解决,庆祝一下。
我下载的是目前最新的版本mysql-5.0.45-linux-i686.tar.gz
安装过程:
su到root权限。
#tar-zvxfmysql-5.0.45-linux-i686.tar.gz
#mvmysql-5.0.45//usr/local/mysql
#cd/usr/local/mysql
#groupaddmysql
#useradd-gmysqlmysql
#chown-Rmysql.
#chgrp-Rmysql.
#scripts/mysql_install_db--user=mysql
#chown-Rroot.
#chown-Rmysqldata
#bin/mysqld_safe--user=mysql&
按照官方文档说这就应该能启动了,可是报错如下:
nohup:ignoringinputandredirectingstderrtostdout
Startingmysqlddaemonwithdatabasesfrom/var/lib/mysql
STOPPINGserverfrompidfile/var/run/mysqld/mysqld.pid
07111200:22:06mysqldended
查看日志:
#less/var/log/mysqld.log
其中有一段如下:
0711120:22:06[ERROR]/usr/local/mysql/bin/mysqld:Can''tcreate/writetofile''/var/run/mysqld/mysqld.pid''(Errcode:2)
0711120:22:06[ERROR]Can''tstartserver:can''tcreatePIDfile:Nosuchfileordirectory
07111200:22:06mysqldended
#cd/var/run/
#ls
mysqld目录不存在
#mkdir/var/run/mysqld
#cd/var/run/mysqld
创建文件mysqld.pid
#touchmysqld.pid
#cd..
#chown-Rmysqlmysqld.
#cd/usr/local/mysql/
#bin/mysqld_safe--user=mysql&
nohup:ignoringinputandredirectingstderrtostdout
Startingmysqlddaemonwithdatabasesfrom/var/lib/mysql
能正常启动
#bin/mysqladmin-urootpasswordroot
又出错
[root@localhostmysql]#bin/mysqladmin-urootpasswordroot
bin/mysqladmin:connecttoserverat''localhost''failed
error:''Can''tconnecttolocalMySQLserverthroughsocket''/tmp/mysql.sock''(2)''
Checkthatmysqldisrunningandthatthesocket:''/tmp/mysql.sock''exists!
[root@localhostmysql]#bin/mysql-uroot-p
Enterpassword:
ERROR2002(HY000):Can''tconnecttolocalMySQLserverthroughsocket''/tmp/mysql.sock''(2)
分析:是/tmp/mysql.sock不存在
#cd/var/lib/mysql/
ibdata1ib_logfile0ib_logfile1mysql/mysql.socktest/
由于mysql默认的mysql.sock是在/var/lib/mysql/mysql.sock,
创建符号连接:
#ln-s/var/lib/mysql/mysql.sock/tmp/mysql.sock
#bin/mysql-uroot
WelcometotheMySQLmonitor.Commandsendwith;or\g.
YourMySQLconnectionidis1
Serverversion:5.0.45MySQLCommunityServer(GPL)
Type''help;''or''\h''forhelp.Type''\c''toclearthebuffer.
mysql>
修改root密码
#cd/usr/local/mysql/
#bin/mysqladmin-uroot-ppasswordyourpassword
一切ok。
fedora8安装mysqlfedora8安装mysqlfedora8安装mysqlfedora8安装mysqlfedora8安装mysqlfedora8安装mysqlfedora8安装mysqlfedora8安装mysqlfedora8安装mysqlfedora8安装mysql
阅读(569) | 评论(0) | 转发(0) |