安裝mysql5.6報錯問題統計點

來源:互聯網
上載者:User

標籤:The   tin   ati   exit   man   mod   can   str   service   

報錯1(su進入mysql屬組時報錯):

[[email protected] ~]# su - mysql

Last login: Thu Aug 31 17:20:03 CST 2017 on pts/1

su: warning: cannot change directory to /home/mysql: No such file or directory

-bash-4.2$ exit

解決方案:

[[email protected] ~]# cd /home

[[email protected] home]# ls

 xiniu

[[email protected] home]# mkdir /home/mysql

[[email protected] home]# chmod 755 /home/mysql

[[email protected] home]# ls

mysql   xiniu

[[email protected] home]# cp -a /etc/skel/. /home/mysql/

[[email protected] home]# su - mysql

Last login: Thu Aug 31 17:20:58 CST 2017 on pts/1

[[email protected] ~]$ id

uid=987(mysql) gid=1003(mysql) 組=1003(mysql) 環境=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

 

報錯2(啟動報錯):

[[email protected] mysql]# /etc/init.d/mysql start

Starting MySQL. ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).

解決方案:

#rm -rf /usr/local/mysql/data

# chown -R mysql.mysql .

# cd  /usr/local/mysql

# scripts/mysql_install_db

# /usr/local/mysql/bin/mysqld_safe --user=root &

# ls    /usr/local/mysql/data/

# /etc/init.d/mysqld start
Starting MySQL SUCCESS!   ##啟動成功

 

報錯3(啟動報錯):

/etc/init.d/mysql: line 256: my_print_defaults: command not found

/etc/init.d/mysql: line 276: cd: /usr/local/mysql: No such file or directory

Starting MySQL ERROR! Couldn‘t find MySQL server (/usr/local/mysql/bin/mysqld_safe)

解決辦法:
編輯/etc/my.cnf 檔案,因為缺少basedir 和 datadir 兩個路徑,在 [mysqld] 添加上即可
#vim /etc/my.cnf
[mysqld]
...........
...........
basedir=/usr/local/mysql          ##修改成自己安裝路徑
datadir=/usr/local/mysql/data  ##修改成自己安裝路徑

儲存退出,然後重新啟動就可以.

[[email protected] mysql]# vim /etc/my.cnf

[[email protected] mysql]# service mysql start

Starting MySQL........................................ SUCCESS!

安裝mysql5.6報錯問題統計點

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.