標籤: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報錯問題統計點