溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

怎么在fedora8系統(tǒng)中安裝mysql服務(wù)

發(fā)布時間:2021-03-08 10:55:40 來源:億速云 閱讀:174 作者:Leah 欄目:系統(tǒng)運維

這篇文章將為大家詳細講解有關(guān)怎么在fedora8系統(tǒng)中安裝mysql服務(wù),文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關(guān)知識有一定的了解。

安裝過程:

su 到root 權(quán)限。

#tar -zvxf mysql-5.0.45-linux-i686.tar.gz

#mv mysql-5.0.45/ /usr/local/mysql

#cd /usr/local/mysql

#groupadd mysql

#useradd -g mysql mysql

#chown -R mysql .

#chgrp -R mysql .

#scripts/mysql_install_db --user=mysql

#chown -R root .

#chown -R mysql data

#bin/mysqld_safe --user=mysql &

按照官方文檔說這就應(yīng)該能啟動了,可是報錯如下:

nohup: ignoring input and redirecting stderr to stdout

Starting mysqld daemon with databases from /var/lib/mysql

STOPPING server from pid file /var/run/mysqld/mysqld.pid

071112 00:22:06 mysqld ended

查看日志:

#less /var/log/mysqld.log

其中有一段如下:

071112 0:22:06 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)

071112 0:22:06 [ERROR] Can't start server: can't create PID file: No such file or directory

071112 00:22:06 mysqld ended

#cd /var/run/

#ls

mysqld目錄不存在

#mkdir /var/run/mysqld

#cd /var/run/mysqld

創(chuàng)建文件mysqld.pid

#touch mysqld.pid

#cd..

#chown -R mysql mysqld .

#cd /usr/local/mysql/

#bin/mysqld_safe --user=mysql &

nohup: ignoring input and redirecting stderr to stdout

Starting mysqld daemon with databases from /var/lib/mysql

能正常啟動

#bin/mysqladmin -u root password root

又出錯

[root@localhost mysql]# bin/mysqladmin -u root password root

bin/mysqladmin: connect to server at 'localhost' failed

error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'

Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

[root@localhost mysql]# bin/mysql -u root -p

Enter password:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

分析:是/tmp/mysql.sock 不存在

# cd /var/lib/mysql/

ibdata1 ib_logfile0 ib_logfile1 mysql/ mysql.sock test/

由于mysql 默認(rèn)的mysql.sock 是在/var/lib/mysql/mysql.sock,

創(chuàng)建符號連接:

# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

# bin/mysql -u root

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.45 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

修改root 密碼

#cd /usr/local/mysql/

#bin/mysqladmin -u root -p password yourpassword

關(guān)于怎么在fedora8系統(tǒng)中安裝mysql服務(wù)就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。

向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI